as_enqueue_async_action()
as_enqueue_async_action(string $hook, array $args = array(), string $group = '', bool $unique = false, int $priority = 10) : int
Enqueue an action to run one time, as soon as possible
Parameters
string | $hook | The hook to trigger. |
array | $args | Arguments to pass when the hook triggers. |
string | $group | The group to assign this job to. |
bool | $unique | Whether the action should be unique. It will not be scheduled if another pending or running action has the same hook and group parameters. |
int | $priority | Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255. |
Returns
int —The action ID. Zero if there was an error scheduling the action.