\Action_Scheduler\WP_CLI\ActionCreate_Command

WP-CLI command: action-scheduler action create

Summary

Methods
Properties
Constants
__construct()
execute()
No public properties found
DATE_FORMAT
ASYNC_OPTS
get_schedule_display_string()
process_csv_arguments_to_arrays()
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'

ASYNC_OPTS

ASYNC_OPTS = array('async', 0)

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.

print_success()

print_success(int  $action_id, string  $action_type) : void

Print a success message with the action ID.

Parameters

int $action_id

Created action ID.

string $action_type

Type of action.

print_error()

print_error(\Exception  $e) : void

Convert an exception into a WP CLI error.

Parameters

\Exception $e

The error object.

Throws

\WP_CLI\ExitException

When an error occurs.