Skip to content

pre_as_enqueue_async_action

Joe Dolson edited this page May 15, 2026 · 3 revisions

Provides an opportunity to short-circuit the default process for enqueuing async actions.

Returning a value other than null from the filter will short-circuit the normal process. The expectation in such a scenario is that callbacks will return an integer representing the enqueued action ID (enqueued using some alternative process) or else zero.

Auto-generated Example

add_filter(
   'pre_as_enqueue_async_action',
    function(
        int $pre_option = null,
        string $hook,
        array $args,
        string $group,
        int $priority,
        bool $unique
    ) {
        // Your code here.
        return null;
    },
    10,
    6
);

Parameters

  • int|null $pre_option The value to return instead of the option value.
  • string $hook Action hook.
  • array $args Action arguments.
  • string $group Action group.
  • int $priority Action priority.
  • bool $unique Unique action.

Files

apply_filters( 'pre_as_enqueue_async_action', null, $hook, $args, $group, $priority, $unique )

← All Hooks

Clone this wiki locally