wp_next_scheduled filter-hookWP 6.8.0

Filters the timestamp of the next scheduled event for the given hook.

Usage

add_filter( 'wp_next_scheduled', 'wp_kama_next_scheduled_filter', 10, 3 );

/**
 * Function for `wp_next_scheduled` filter-hook.
 * 
 * @param int    $timestamp  Unix timestamp (UTC) for when to next run the event.
 * @param object $next_event An object containing an event's data.
 * @param        $args       
 *
 * @return int
 */
function wp_kama_next_scheduled_filter( $timestamp, $next_event, $args ){

	// filter...
	return $timestamp;
}
$timestamp(int)
Unix timestamp (UTC) for when to next run the event.
$next_event(object)

An object containing an event's data.

  • hook(string)
    Action hook of the event.

  • timestamp(int)
    Unix timestamp (UTC) for when to next run the event.

  • schedule(string)
    How often the event should subsequently recur.

  • args(array)
    Array containing each separate argument to pass to the hook callback function.

  • interval(int)
    Optional. The interval time in seconds for the schedule. Only present for recurring events.
$args
-

Changelog

Since 6.8.0 Introduced.

Where the hook is called

wp_next_scheduled()
wp_next_scheduled
wp-includes/cron.php 859
return apply_filters( 'wp_next_scheduled', $next_event->timestamp, $next_event, $hook, $args );

Where the hook is used in WordPress

Usage not found.