ActionScheduler_ActionFactory::recurring()publicWC 1.0

Create the first instance of an action recurring on a given interval.

{} Это метод класса: ActionScheduler_ActionFactory{}

Хуков нет.


int. The ID of the stored action


$ActionScheduler_ActionFactory = new ActionScheduler_ActionFactory();
$ActionScheduler_ActionFactory->recurring( $hook, $args, $first, $interval, $group );
$hook(строка) (обязательный)
The hook to trigger when this action runs
Args to pass when the hook is triggered
По умолчанию: array()
Unix timestamp for the first run
По умолчанию: null
Seconds between runs
По умолчанию: null
A group to put the action in
По умолчанию: ''

Код ActionScheduler_ActionFactory::recurring() WC 6.9.4

public function recurring( $hook, $args = array(), $first = null, $interval = null, $group = '' ) {
	if ( empty($interval) ) {
		return $this->single( $hook, $args, $first, $group );
	$date = as_get_datetime_object( $first );
	$schedule = new ActionScheduler_IntervalSchedule( $date, $interval );
	$action = new ActionScheduler_Action( $hook, $args, $schedule, $group );
	return $this->store( $action );