clean()
clean(array $args, array $assoc_args) : mixed
Run the Action Scheduler Queue Cleaner
OPTIONS
[--batch-size=<size>] : The maximum number of actions to delete per batch. Defaults to 20.
[--batches=<size>] : Limit execution to a number of batches. Defaults to 0, meaning batches will continue all eligible actions are deleted.
[--status=<status>]
: Only clean actions with the specified status. Defaults to Canceled, Completed. Define multiple statuses as a comma separated string (without spaces), e.g. --status=complete,failed,canceled
[--before=<datestring>]
: Only delete actions with scheduled date older than this. Defaults to 31 days. e.g --before='7 days ago'
, --before='02-Feb-2020 20:20:20'
[--pause=<seconds>] : The number of seconds to pause between batches. Default no pause.
Parameters
array | $args | Positional arguments. |
array | $assoc_args | Keyed arguments. |
Throws
- \WP_CLI\ExitException
When an error occurs.