-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed subcommand registration, namespace, and package files. #5
Conversation
The subcommand registration should be simple as that - as documented in wp-cli/wp-cli.github.com#269 and wp-cli/wp-cli#1767 Further resources |
Updated for the committed vendor packages. Ensure to use |
The subcommand works correctly when registering for the diff --git a/plugin.php b/plugin.php
index d2cc886..8ede851 100644
--- a/plugin.php
+++ b/plugin.php
@@ -26,4 +26,5 @@ include_once __DIR__ . '/vendor/autoload.php';
add_action('cli_init', function () {
WP_CLI::add_command('db export-clean', __NAMESPACE__ . '\CliCommand');
+ WP_CLI::add_command('user export-clean', __NAMESPACE__ . '\CliCommand');
}); |
wp-cli/wp-cli#5274 might be a relevant fix. The registration of
The commands themselves, too:
One difference is this directive on the DB class: * @when after_wp_config_load It causes the db commands to skip most of the WordPress bootstrap:
Therefore, WP-CLI dispatches to the db command very early in the bootstrap (visible when running with The solution is to restore the wp-cli.yml in the project root to load the additional command in the early WP-CLI bootstrap: require:
- wp-content/mu-plugins/wp-cli-db-export-clean.php And also override the bootstrap level for the * @when after_wp_load Just committed those changes. |
Objectives
wp db export-clean