wordpress / latest / functions / wp_next_scheduled.html

wp_next_scheduled( string $hook, array $args = array() ): int|false

Retrieve the next timestamp for an event.

Parameters

$hook string Required
Action hook of the event.
$args array Optional
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, so they should be the same as those used when originally scheduling the event.

Default: array()

Return

int|false The Unix timestamp of the next time the event will occur. False if the event doesn't exist.

Source

File: wp-includes/cron.php. View all references

function wp_next_scheduled( $hook, $args = array() ) {
	$next_event = wp_get_scheduled_event( $hook, $args );
	if ( ! $next_event ) {
		return false;
	}

	return $next_event->timestamp;
}

Used By

Used By Description

Changelog

Version Description
2.1.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_next_scheduled