ActionScheduler_ActionFactory::cron()
Create the first instance of an action recurring on a Cron schedule.
Method of the class: ActionScheduler_ActionFactory{}
No Hooks.
Return
Int
. The ID of the stored action.
Usage
$ActionScheduler_ActionFactory = new ActionScheduler_ActionFactory(); $ActionScheduler_ActionFactory->cron( $hook, $args, $base_timestamp, $schedule, $group );
- $hook(string) (required)
- The hook to trigger when this action runs.
- $args(array)
- Args to pass when the hook is triggered.
Default: array() - $base_timestamp(int)
- The first instance of the action will be scheduled to run at a time calculated after this timestamp matching the cron expression. This can be used to delay the first instance of the action.
Default: null - $schedule(int)
- A cron definition string.
Default: null - $group(string)
- A group to put the action in.
Default: ''
ActionScheduler_ActionFactory::cron() ActionScheduler ActionFactory::cron code WC 8.7.0
public function cron( $hook, $args = array(), $base_timestamp = null, $schedule = null, $group = '' ) { return $this->cron_unique( $hook, $args, $base_timestamp, $schedule, $group, false ); }