as_schedule_recurring_action()WC 1.0

Schedule a recurring action

Хуков нет.

Возвращает

int. The action ID.

Использование

as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args, $group );
$timestamp(int) (обязательный)
When the first instance of the job will run.
$interval_in_seconds(int) (обязательный)
How long to wait between runs.
$hook(строка) (обязательный)
The hook to trigger.
$args(массив)
Arguments to pass when the hook triggers.
По умолчанию: array()
$group(строка)
The group to assign this job to.
По умолчанию: ''

Код as_schedule_recurring_action() WC 6.9.1

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 );
}