ActionScheduler_ActionFactory::async_unique()publicWC 1.0

Same as async, but also supports $unique param.

Method of the class: ActionScheduler_ActionFactory{}

No Hooks.


Int. The ID of the stored action.


$ActionScheduler_ActionFactory = new ActionScheduler_ActionFactory();
$ActionScheduler_ActionFactory->async_unique( $hook, $args, $group, $unique );
$hook(string) (required)
The hook to trigger when this action runs.
Args to pass when the hook is triggered.
Default: array()
A group to put the action in.
Default: ''
Whether to ensure the action is unique.
Default: true

ActionScheduler_ActionFactory::async_unique() code 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 );