as_schedule_recurring_action()
Schedule a recurring action
No Hooks.
Return
Int
. The action ID.
Usage
as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args, $group );
- $timestamp(int) (required)
- When the first instance of the job will run.
- $interval_in_seconds(int) (required)
- How long to wait between runs.
- $hook(string) (required)
- The hook to trigger.
- $args(array)
- Arguments to pass when the hook triggers.
Default: array() - $group(string)
- The group to assign this job to.
Default: ''
as_schedule_recurring_action() as schedule recurring action code WC 7.3.0
function as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '' ) { if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) { return 0; } return ActionScheduler::factory()->recurring( $hook, $args, $timestamp, $interval_in_seconds, $group ); }