wppaste
WordPress

apply_filters( 'pre_get_scheduled_event', null|false|object $pre, string $hook, array $args, int|null $timestamp )

Since
5.1.0
Filter to override retrieving a scheduled event.

Description

Returning a non-null value will short-circuit the normal process, returning the filtered value instead.

Return false if the event does not exist, otherwise an event object should be returned.

Compatibility

WordPress
since 5.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$prenull|false|object
Value to return instead. Default null to continue retrieving the event.
$hookstring
Action hook of the event.
$argsarray
Array containing each separate argument to pass to the hook's callback function.
Although not passed to a callback, these arguments are used to uniquely identify the event.
$timestampint|null
Unix timestamp (UTC) of the event. Null to retrieve next scheduled event.

Where this hook fires · 1

  • wp-includes/cron.php:797wp_get_scheduled_event()

Source code

<?php	 * @param string            $hook Action hook of the event.	 * @param array             $args Array containing each separate argument to pass to the hook's callback function.	 *                                Although not passed to a callback, these arguments are used to uniquely identify	 *                                the event.	 * @param int|null  $timestamp Unix timestamp (UTC) of the event. Null to retrieve next scheduled event.	 */	$pre = apply_filters( 'pre_get_scheduled_event', null, $hook, $args, $timestamp ); 	if ( null !== $pre ) {		return $pre;	} 	if ( null !== $timestamp && ! is_numeric( $timestamp ) ) {

Changelog

Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.