Skip to content

pre_as_schedule_single_action

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

Provides an opportunity to short-circuit the default process for enqueuing single 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 scheduled action ID (scheduled using some alternative process) or else zero.

Auto-generated Example

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

Parameters

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

Files

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

← All Hooks

Clone this wiki locally