WP_CLI\Bootstrap
DefineProtectedCommands::process()
Process this single bootstrapping step.
Method of the class: DefineProtectedCommands{}
No Hooks.
Return
BootstrapState
. Modified state to pass to the next step.
Usage
$DefineProtectedCommands = new DefineProtectedCommands(); $DefineProtectedCommands->process( $state );
- $state(BootstrapState) (required)
- Contextual state to pass into the step.
DefineProtectedCommands::process() DefineProtectedCommands::process code WP-CLI 2.8.0-alpha
public function process( BootstrapState $state ) { $commands = $this->get_protected_commands(); $current_command = $this->get_current_command(); foreach ( $commands as $command ) { if ( 0 === strpos( $current_command, $command ) ) { $state->setValue( BootstrapState::IS_PROTECTED_COMMAND, true ); } } return $state; }