WP_CLI\Dispatcher
RootCommand{}└─ CompositeCommand
The root node in the command tree.
No Hooks.
Usage
$RootCommand = new RootCommand(); // use class methods
Methods
- public __construct()
- public find_subcommand( &$args )
- public get_longdesc()
Notes
- Package: WP_CLI
RootCommand{} RootCommand{} code WP-CLI 2.13.0-alpha
class RootCommand extends CompositeCommand {
public function __construct() {
$this->parent = false;
$this->name = 'wp';
$this->shortdesc = 'Manage WordPress through the command-line.';
}
/**
* Get the human-readable long description.
*
* @return string
*/
public function get_longdesc() {
return $this->get_global_params( true );
}
/**
* Find a subcommand registered on the root
* command.
*
* @param array $args
* @return Subcommand|false
*/
public function find_subcommand( &$args ) {
$command = array_shift( $args );
Utils\load_command( $command );
if ( ! isset( $this->subcommands[ $command ] ) ) {
return false;
}
return $this->subcommands[ $command ];
}
}