ActionScheduler_ActionFactory::async_unique()publicWC 1.0

Same as async, but also supports $unique param.

Method of the class: ActionScheduler_ActionFactory{}

No Hooks.

Return

Int. The ID of the stored action.

Usage

$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(array)
Args to pass when the hook is triggered.
Default: array()
$group(string)
A group to put the action in.
Default: ''
$unique(true|false)
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 );
}