Action_Scheduler\WP_CLI\Action
Cancel_Command::execute
Execute command.
Method of the class: Cancel_Command{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Cancel_Command = new Cancel_Command(); $Cancel_Command->execute();
Cancel_Command::execute() Cancel Command::execute code WC 10.6.2
public function execute() {
$hook = '';
$group = get_flag_value( $this->assoc_args, 'group', '' );
$callback_args = get_flag_value( $this->assoc_args, 'args', null );
$all = get_flag_value( $this->assoc_args, 'all', false );
if ( ! empty( $this->args[0] ) ) {
$hook = $this->args[0];
}
if ( ! empty( $callback_args ) ) {
$callback_args = json_decode( $callback_args, true );
}
if ( $all ) {
$this->cancel_all( $hook, $callback_args, $group );
return;
}
$this->cancel_single( $hook, $callback_args, $group );
}