-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathentity-command.php
More file actions
131 lines (121 loc) · 3.78 KB
/
entity-command.php
File metadata and controls
131 lines (121 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
use WP_CLI\Utils;
if ( ! class_exists( 'WP_CLI' ) ) {
return;
}
$wpcli_entity_autoloader = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $wpcli_entity_autoloader ) ) {
require_once $wpcli_entity_autoloader;
}
// Load the BlockProcessorLoader class (but don't call load() yet).
// The polyfills will be loaded on-demand by Block_Processor_Helper
// when needed, ensuring WordPress classes take precedence if available.
require_once __DIR__ . '/src/Compat/BlockProcessorLoader.php';
WP_CLI::add_command( 'comment', 'Comment_Command' );
WP_CLI::add_command( 'comment meta', 'Comment_Meta_Command' );
WP_CLI::add_command( 'menu', 'Menu_Command' );
WP_CLI::add_command( 'menu item', 'Menu_Item_Command' );
WP_CLI::add_command( 'menu location', 'Menu_Location_Command' );
WP_CLI::add_command(
'network meta',
'Network_Meta_Command',
array(
'before_invoke' => function () {
if ( ! is_multisite() ) {
WP_CLI::error( 'This is not a multisite installation.' );
}
},
)
);
WP_CLI::add_command( 'option', 'Option_Command' );
WP_CLI::add_command( 'post', 'Post_Command' );
WP_CLI::add_command(
'post block',
'Post_Block_Command',
array(
'before_invoke' => function () {
if ( Utils\wp_version_compare( '5.0', '<' ) ) {
WP_CLI::error( 'Requires WordPress 5.0 or greater.' );
}
},
)
);
WP_CLI::add_command( 'post meta', 'Post_Meta_Command' );
WP_CLI::add_command( 'post revision', 'Post_Revision_Command' );
WP_CLI::add_command( 'post term', 'Post_Term_Command' );
WP_CLI::add_command( 'post-type', 'Post_Type_Command' );
WP_CLI::add_command( 'site', 'Site_Command' );
WP_CLI::add_command(
'site meta',
'Site_Meta_Command',
array(
'before_invoke' => function () {
/**
* @var \wpdb $wpdb
*/
global $wpdb;
if ( ! is_multisite() ) {
WP_CLI::error( 'This is not a multisite installation.' );
}
if ( ! function_exists( 'is_site_meta_supported' ) || ! is_site_meta_supported() ) {
WP_CLI::error( sprintf( 'The %s table is not installed. Please run the network database upgrade.', $wpdb->blogmeta ) );
}
},
)
);
WP_CLI::add_command(
'site option',
'Site_Option_Command',
array(
'before_invoke' => function () {
if ( ! is_multisite() ) {
WP_CLI::error( 'This is not a multisite installation.' );
}
},
)
);
WP_CLI::add_command( 'taxonomy', 'Taxonomy_Command' );
WP_CLI::add_command( 'term', 'Term_Command' );
WP_CLI::add_command( 'term meta', 'Term_Meta_Command' );
WP_CLI::add_command( 'user', 'User_Command' );
WP_CLI::add_command(
'user application-password',
'User_Application_Password_Command',
array(
'before_invoke' => function () {
if ( Utils\wp_version_compare( '5.6', '<' ) ) {
WP_CLI::error( 'Requires WordPress 5.6 or greater.' );
}
},
)
);
WP_CLI::add_command( 'user meta', 'User_Meta_Command' );
WP_CLI::add_command( 'user session', 'User_Session_Command' );
WP_CLI::add_command( 'user term', 'User_Term_Command' );
if ( class_exists( 'WP_CLI\Dispatcher\CommandNamespace' ) ) {
WP_CLI::add_command( 'network', 'Network_Namespace' );
}
WP_CLI::add_command(
'user signup',
'Signup_Command',
array(
'before_invoke' => function () {
if ( ! is_multisite() ) {
WP_CLI::error( 'This is not a multisite installation.' );
}
},
)
);
if ( class_exists( 'WP_CLI\Dispatcher\CommandNamespace' ) ) {
WP_CLI::add_command( 'font', 'Font_Namespace' );
}
$wpcli_entity_font_version_check = array(
'before_invoke' => function () {
if ( Utils\wp_version_compare( '6.5', '<' ) ) {
WP_CLI::error( 'Requires WordPress 6.5 or greater.' );
}
},
);
WP_CLI::add_command( 'font collection', 'Font_Collection_Command', $wpcli_entity_font_version_check );
WP_CLI::add_command( 'font family', 'Font_Family_Command', $wpcli_entity_font_version_check );
WP_CLI::add_command( 'font face', 'Font_Face_Command', $wpcli_entity_font_version_check );