Skip to content

Commit

Permalink
Register the cli commands when bootstrapping the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonwebz committed Jun 24, 2024
1 parent 86fb933 commit 64bdc00
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions includes/classes/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function __construct() {
// The REST api must load if admin or not.
$rest_api = new REST_Api();
$rest_api->init_hooks();

// When WP CLI is enabled, load the CLI commands.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
$cli = new BootstrapCLI();
$cli->register();
}
}

/**
Expand All @@ -53,10 +59,5 @@ private function init() {

$frontend_validate = new Frontend_Validate();
$frontend_validate->init_hooks();

if ( defined( 'WP_CLI' ) && WP_CLI ) {
$cli = new BootstrapCLI();
$cli->register();
}
}
}

0 comments on commit 64bdc00

Please sign in to comment.