ActionScheduler_ActionFactory::async()publicWC 1.0

Enqueue an action to run one time, as soon as possible (rather a specific scheduled time).

This method creates a new action using the NullSchedule. In practice, this results in an action scheduled to execute "now". Therefore, it will generally run as soon as possible but is not prioritized ahead of other actions that are already past-due.

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

Хуков нет.

Возвращает

int. The ID of the stored action.

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

$ActionScheduler_ActionFactory = new ActionScheduler_ActionFactory();
$ActionScheduler_ActionFactory->async( $hook, $args, $group );
$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.
По умолчанию: ''

Код ActionScheduler_ActionFactory::async() WC 8.7.0

public function async( $hook, $args = array(), $group = '' ) {
	return $this->async_unique( $hook, $args, $group, false );
}