pre_as_schedule_single_action
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.
Usage
add_filter( 'pre_as_schedule_single_action', 'wp_kama_pre_as_schedule_single_action_filter', 10, 7 );
/**
* Function for `pre_as_schedule_single_action` filter-hook.
*
* @param int|null $pre_option The value to return instead of the option value.
* @param int $timestamp When the action will run.
* @param string $hook Action hook.
* @param array $args Action arguments.
* @param string $group Action group.
* @param int $priorities Action priority.
* @param bool $unique Unique action.
*
* @return int|null
*/
function wp_kama_pre_as_schedule_single_action_filter( $pre_option, $timestamp, $hook, $args, $group, $priorities, $unique ){
// filter...
return $pre_option;
}
- $pre_option(int|null)
- The value to return instead of the option value.
- $timestamp(int)
- When the action will run.
- $hook(string)
- Action hook.
- $args(array)
- Action arguments.
- $group(string)
- Action group.
- $priorities(int)
- Action priority.
- $unique(true|false)
- Unique action.
Where the hook is called
pre_as_schedule_single_action
woocommerce/packages/action-scheduler/functions.php 91
$pre = apply_filters( 'pre_as_schedule_single_action', null, $timestamp, $hook, $args, $group, $priority, $unique );