Skip to content

Commit be0c029

Browse files
committed
Add block-related post commands
1 parent 6617538 commit be0c029

File tree

6 files changed

+3566
-2
lines changed

6 files changed

+3566
-2
lines changed

composer.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,23 @@
120120
"post term set",
121121
"post update",
122122
"post url-to-id",
123+
"post has-blocks",
124+
"post has-block",
125+
"post block",
126+
"post block parse",
127+
"post block render",
128+
"post block list",
129+
"post block insert",
130+
"post block remove",
131+
"post block replace",
132+
"post block get",
133+
"post block update",
134+
"post block move",
135+
"post block export",
136+
"post block import",
137+
"post block count",
138+
"post block clone",
139+
"post block extract",
123140
"post-type",
124141
"post-type get",
125142
"post-type list",
@@ -234,7 +251,6 @@
234251
"phpstan": "run-phpstan-tests",
235252
"phpunit": "run-php-unit-tests",
236253
"phpcbf": "run-phpcbf-cleanup",
237-
"phpstan": "run-phpstan-tests",
238254
"prepare-tests": "install-package-tests",
239255
"test": [
240256
"@lint",

entity-command.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
);
3030
WP_CLI::add_command( 'option', 'Option_Command' );
3131
WP_CLI::add_command( 'post', 'Post_Command' );
32+
WP_CLI::add_command(
33+
'post block',
34+
'Post_Block_Command',
35+
array(
36+
'before_invoke' => function () {
37+
if ( Utils\wp_version_compare( '5.0', '<' ) ) {
38+
WP_CLI::error( 'Requires WordPress 5.0 or greater.' );
39+
}
40+
},
41+
)
42+
);
3243
WP_CLI::add_command( 'post meta', 'Post_Meta_Command' );
3344
WP_CLI::add_command( 'post term', 'Post_Term_Command' );
3445
WP_CLI::add_command( 'post-type', 'Post_Type_Command' );

0 commit comments

Comments
 (0)