WP_CLI\Dispatcher
Subcommand::get_parameters()
Get an array of parameter names, by merging the command-specific and the global parameters.
Method of the class: Subcommand{}
No Hooks.
Return
Array
. Array of parameter names
Usage
// private - for code of main (parent) class only $result = $this->get_parameters( $spec );
- $spec(array)
- Specification of the current command.
Default: []
Subcommand::get_parameters() Subcommand::get parameters code WP-CLI 2.8.0-alpha
private function get_parameters( $spec = [] ) { $local_parameters = array_column( $spec, 'name' ); $global_parameters = array_column( SynopsisParser::parse( $this->get_global_params() ), 'name' ); return array_unique( array_merge( $local_parameters, $global_parameters ) ); }