ActionScheduler_ActionFactory::async_unique
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() ActionScheduler ActionFactory::async unique WC 11.3.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 );
}