\Action_Scheduler\WP_CLI\ActionCancel_Command

WP-CLI command: action-scheduler action cancel

Summary

Methods
Properties
Constants
__construct()
execute()
No public properties found
DATE_FORMAT
get_schedule_display_string()
process_csv_arguments_to_arrays()
cancel_single()
cancel_all()
print_success()
print_error()
$args
$assoc_args
N/A
No private methods found
No private properties found
N/A

Constants

DATE_FORMAT

DATE_FORMAT = 'Y-m-d H:i:s O'

Properties

$args

$args : string[]

Keyed arguments.

Type

normal

$assoc_args

$assoc_args : array<string,string>

Positional arguments.

Type

normal

Methods

__construct()

__construct(string[]  $args, array<string,string>  $assoc_args) : mixed

Construct.

Parameters

string[] $args

Positional arguments.

array $assoc_args

Keyed arguments.

Throws

\Exception

When loading a CLI command file outside of WP CLI context.

Returns

mixed

execute()

execute() : void

Execute command.

get_schedule_display_string()

get_schedule_display_string(\ActionScheduler_Schedule  $schedule) : string

Get the scheduled date in a human friendly format.

Parameters

\ActionScheduler_Schedule $schedule

Schedule.

Returns

string

process_csv_arguments_to_arrays()

process_csv_arguments_to_arrays() : void

Transforms arguments with '__' from CSV into expected arrays.

cancel_single()

cancel_single(string  $hook, array  $callback_args, string  $group) : void

Cancel single action.

Parameters

string $hook

The hook that the job will trigger.

array $callback_args

Args that would have been passed to the job.

string $group

The group the job is assigned to.

cancel_all()

cancel_all(string  $hook, array  $callback_args, string  $group) : void

Cancel all actions.

Parameters

string $hook

The hook that the job will trigger.

array $callback_args

Args that would have been passed to the job.

string $group

The group the job is assigned to.

print_success()

print_success() : void

Print a success message.

print_error()

print_error(\Exception  $e, bool  $multiple) : void

Convert an exception into a WP CLI error.

Parameters

\Exception $e

The error object.

bool $multiple

Boolean if multiple actions.

Throws

\WP_CLI\ExitException

When an error occurs.