ActionScheduler_ActionFactory::async_unique()publicWC 1.0

Same as async, but also supports $unique param.

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

Хуков нет.

Возвращает

int. The ID of the stored action.

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

$ActionScheduler_ActionFactory = new ActionScheduler_ActionFactory();
$ActionScheduler_ActionFactory->async_unique( $hook, $args, $group, $unique );
$hook(строка) (обязательный)
The hook to trigger when this action runs.
$args(массив)
Args to pass when the hook is triggered.
По умолчанию: array()
$group(строка)
A group to put the action in.
По умолчанию: ''
$unique(true|false)
Whether to ensure the action is unique.
По умолчанию: true

Код ActionScheduler_ActionFactory::async_unique() WC 8.7.0

public function async_unique( $hook, $args = array(), $group = '', $unique = true ) {
	$schedule = new ActionScheduler_NullSchedule();
	$action   = new ActionScheduler_Action( $hook, $args, $schedule, $group );
	return $unique ? $this->store_unique_action( $action, $unique ) : $this->store( $action );
}