wp_next_scheduled( string $hook, array $args = array() )

Retrieves the next timestamp for an event.


Parameters

$hook

(Required) Action hook of the event.

$args

(Optional) Array containing each separate argument to pass to the hook's callback function.<br> 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.<br>

Default value: 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

function wp_next_scheduled( $hook, $args = array() ) {
	$crons = _get_cron_array();
	$key = md5(serialize($args));
	if ( empty($crons) )
		return false;
	foreach ( $crons as $timestamp => $cron ) {
		if ( isset( $cron[$hook][$key] ) )
			return $timestamp;
	}
	return false;
}


Changelog

Changelog
Version Description
2.1.0 Introduced.