wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_next_scheduled › WordPress Function

Seit2.1.0
Veraltetn/v
wp_next_scheduled ( $hook, $args = array() )
Parameter: (2)
  • (string) $hook Action hook of the event.
    Erforderlich: Ja
  • (array) $args 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 must match those used when originally scheduling the event. If the arguments do not match exactly, the event will not be found. Default empty array.
    Erforderlich: Nein
    Standard: array()
Gibt zurück:
  • (int|false) The Unix timestamp (UTC) of the next time the event will occur. False if the event doesn't exist.
Definiert in:
Codex:

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



Quellcode

function wp_next_scheduled( $hook, $args = array() ) {
	$next_event = wp_get_scheduled_event( $hook, $args );

	if ( ! $next_event ) {
		return false;
	}

	/**
	 * 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 string $hook       Action hook of the event.
	 * @param array  $args       Array containing each separate argument to pass to the hook
	 *                           callback function.
	 */
	return apply_filters( 'wp_next_scheduled', $next_event->timestamp, $next_event, $hook, $args );
}