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



wp_get_schedule ›

Seit2.1.0
Veraltetn/v
wp_get_schedule ( $hook, $args = array() )
Parameter: (2)
  • (string) $hook Action hook to identify the event.
    Erforderlich: Ja
  • (array) $args Optional. Arguments passed to the event's callback function.
    Erforderlich: Nein
    Standard: array()
Siehe:
Gibt zurück:
  • (string|false) False, if no schedule. Schedule name on success.
Definiert in:
Codex:
Changelog:
  • 5.0.0

Retrieve the recurrence schedule for an event.



Quellcode

function wp_get_schedule( $hook, $args = array() ) {
	$schedule = false;
	$event    = wp_get_scheduled_event( $hook, $args );

	if ( $event ) {
		$schedule = $event->schedule;
	}

	/**
	 * Filter the schedule for a hook.
	 *
	 * @since 5.0.0
	 *
	 * @param string|bool $schedule Schedule for the hook. False if not found.
	 * @param string      $hook     Action hook to execute when cron is run.
	 * @param array       $args     Optional. Arguments to pass to the hook's callback function.
	 */
	return apply_filters( 'get_schedule', $schedule, $hook, $args );
}