wp_next_scheduled
Filter HookDescription
Filters the timestamp of the next scheduled event for the given hook. callback function. present for recurring events. }Hook Information
File Location |
wp-includes/cron.php
View on GitHub
|
Hook Type | Filter |
Line Number | 859 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$timestamp
|
Unix timestamp (UTC) for when to next run the event. |
object
|
$next_event
|
{ An object containing an event's data. |
array
|
$args
|
Array containing each separate argument to pass to the hook callback function. |
Usage Examples
Basic Usage
<?php
// Hook into wp_next_scheduled
add_filter('wp_next_scheduled', 'my_custom_filter', 10, 3);
function my_custom_filter($timestamp, $next_event, $args) {
// Your custom filtering logic here
return $timestamp;
}
Source Code Context
wp-includes/cron.php:859
- How this hook is used in WordPress core
<?php
854 * present for recurring events.
855 * }
856 * @param array $args Array containing each separate argument to pass to the hook
857 * callback function.
858 */
859 return apply_filters( 'wp_next_scheduled', $next_event->timestamp, $next_event, $hook, $args );
860 }
861
862 /**
863 * Sends a request to run cron through HTTP request that doesn't halt page loading.
864 *
PHP Documentation
<?php
/**
* Filters the timestamp of the next scheduled event for the given hook.
*
* @since 6.8.0
*
* @param int $timestamp Unix timestamp (UTC) for when to next run the event.
* @param object $next_event {
* An object containing an event's data.
*
* @type string $hook Action hook of the event.
* @type int $timestamp Unix timestamp (UTC) for when to next run the event.
* @type string $schedule How often the event should subsequently recur.
* @type array $args Array containing each separate argument to pass to the hook
* callback function.
* @type int $interval Optional. The interval time in seconds for the schedule. Only
* present for recurring events.
* }
* @param array $args Array containing each separate argument to pass to the hook
* callback function.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/cron.php
Related Hooks
Related hooks will be displayed here in future updates.