Menu

## ActionScheduler_WPCLI_Scheduler_command extends WP_CLI_Command
in package

ActionScheduler_WPCLI_Scheduler_command.php : 6

Commands for the Action Scheduler by Prospress.

### Table of Contents

run() : mixed
  Run the Action Scheduler
print_error() : mixed
  Convert an exception into a WP CLI error.
print_success() : mixed
  Print a success message with the number of completed actions.
print_total_actions() : mixed
  Print WP CLI message about how many actions are about to be processed.
print_total_batches() : mixed
  Print WP CLI message about how many batches of actions were processed.

### Methods

#### run()

ActionScheduler_WPCLI_Scheduler_command.php : 35

Run the Action Scheduler

`public run(array<string|int, mixed> $args, array<string|int, mixed> $assoc_args) : mixed`

## OPTIONS

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

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

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

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

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

##### Parameters

$args : array<string|int, mixed>

  Positional arguments.

$assoc_args : array<string|int, mixed>

  Keyed arguments.

##### Tags

throws
  ExitException

  When an error occurs.

##### Return values

mixed —

#### print_error()

ActionScheduler_WPCLI_Scheduler_command.php : 119

Convert an exception into a WP CLI error.

`protected print_error(Exception $e) : mixed`

##### Parameters

$e : Exception

  The error object.

##### Tags

author

  Jeremy Pry

throws
  ExitException

##### Return values

mixed —

#### print_success()

ActionScheduler_WPCLI_Scheduler_command.php : 136

Print a success message with the number of completed actions.

`protected print_success(int $actions_completed) : mixed`

##### Parameters

$actions_completed : int

##### Tags

author

  Jeremy Pry

##### Return values

mixed —

#### print_total_actions()

ActionScheduler_WPCLI_Scheduler_command.php : 83

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

`protected print_total_actions(int $total) : mixed`

##### Parameters

$total : int

##### Tags

author

  Jeremy Pry

##### Return values

mixed —

#### print_total_batches()

ActionScheduler_WPCLI_Scheduler_command.php : 100

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

`protected print_total_batches(int $batches_completed) : mixed`

##### Parameters

$batches_completed : int

##### Tags

author

  Jeremy Pry

##### Return values

mixed —

## Search results