\ActionScheduler_WPCLI_Scheduler_command

Commands for Action Scheduler.

Summary

Methods
Properties
Constants
fix_schema()
run()
No public properties found
No constants found
print_total_actions()
print_total_batches()
print_error()
print_success()
No protected properties found
N/A
parse_comma_separated_string()
No private properties found
N/A

Methods

fix_schema()

fix_schema(array  $args, array  $assoc_args) : mixed

Force tables schema creation for Action Scheduler

OPTIONS

Parameters

array $args

Positional arguments.

array $assoc_args

Keyed arguments.

Returns

mixed

run()

run(array  $args, array  $assoc_args) : mixed

Run the Action Scheduler

OPTIONS

[--batch-size=<size>] : The maximum number of actions to run. Defaults to 100.

[--batches=<size>] : Limit execution to a number of batches. Defaults to 0, meaning batches will continue being executed until all actions are complete.

[--cleanup-batch-size=<size>] : The maximum number of actions to clean up. Defaults to the value of --batch-size.

[--hooks=<hooks>] : Only run actions with the specified hook. Omitting this option runs actions with any hook. Define multiple hooks as a comma separated string (without spaces), e.g. --hooks=hook_one,hook_two,hook_three

[--group=<group>] : Only run actions from the specified group. Omitting this option runs actions from all groups.

[--exclude-groups=<groups>] : Run actions from all groups except the specified group(s). Define multiple groups as a comma separated string (without spaces), e.g. '--group_a,group_b'. This option is ignored when --group is used.

[--free-memory-on=<count>] : The number of actions to process between freeing memory. 0 disables freeing memory. Default 50.

[--pause=<seconds>] : The number of seconds to pause when freeing memory. Default no pause.

[--force] : Whether to force execution despite the maximum number of concurrent processes being exceeded.

Parameters

array $args

Positional arguments.

array $assoc_args

Keyed arguments.

Throws

\WP_CLI\ExitException

When an error occurs.

Returns

mixed

print_total_actions()

print_total_actions(int  $total) : mixed

Print WP CLI message about how many actions are about to be processed.

Parameters

int $total

Number of actions found.

Returns

mixed

print_total_batches()

print_total_batches(int  $batches_completed) : mixed

Print WP CLI message about how many batches of actions were processed.

Parameters

int $batches_completed

Number of completed batches.

Returns

mixed

print_error()

print_error(\Exception  $e) : mixed

Convert an exception into a WP CLI error.

Parameters

\Exception $e

The error object.

Throws

\WP_CLI\ExitException

Under some conditions WP CLI may throw an exception.

Returns

mixed

print_success()

print_success(int  $actions_completed) : mixed

Print a success message with the number of completed actions.

Parameters

int $actions_completed

Number of completed actions.

Returns

mixed

parse_comma_separated_string()

parse_comma_separated_string(string  $string) : array

Converts a string of comma-separated values into an array of those same values.

Parameters

string $string

The string of one or more comma separated values.

Returns

array