ActionScheduler_QueueRunner::run( string $context = 'WP Cron' )
Process actions in the queue. Attached to self::WP_CRON_HOOK i.e. ‘action_scheduler_run_queue’
Description Description
The $context param of this method defaults to ‘WP Cron’, because prior to Action Scheduler 3.0.0 that was the only context in which this method was run, and the self::WP_CRON_HOOK hook had no context passed along with it. New code calling this method directly, or by triggering the self::WP_CRON_HOOK, should set a context as the first parameter. For an example of this, refer to the code seen in
See also See also
Parameters Parameters
- $context
-
(Optional) identifer for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron' Generally, this should be capitalised and not localised as it's a proper noun.
Default value: 'WP Cron'
Return Return
(int) The number of actions processed.
Source Source
File: packages/action-scheduler/classes/ActionScheduler_QueueRunner.php