Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
972 changes: 965 additions & 7 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- "src/Compat/**/*"
23 changes: 22 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,23 @@
"post term set",
"post update",
"post url-to-id",
"post has-blocks",
"post has-block",
"post block",
"post block clone",
"post block count",
"post block export",
"post block extract",
"post block get",
"post block import",
"post block insert",
"post block list",
"post block move",
"post block parse",
"post block remove",
"post block replace",
"post block render",
"post block update",
"post-type",
"post-type get",
"post-type list",
Expand Down Expand Up @@ -220,6 +237,11 @@
"classmap": [
"src/"
],
"exclude-from-classmap": [
"src/Compat/WP_HTML_Span.php",
"src/Compat/WP_Block_Processor.php",
"src/Compat/polyfills.php"
],
"files": [
"entity-command.php"
]
Expand All @@ -234,7 +256,6 @@
"phpstan": "run-phpstan-tests",
"phpunit": "run-php-unit-tests",
"phpcbf": "run-phpcbf-cleanup",
"phpstan": "run-phpstan-tests",
"prepare-tests": "install-package-tests",
"test": [
"@lint",
Expand Down
16 changes: 16 additions & 0 deletions entity-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
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' );
Expand All @@ -29,6 +34,17 @@
);
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 term', 'Post_Term_Command' );
WP_CLI::add_command( 'post-type', 'Post_Type_Command' );
Expand Down
Loading