wp_get_schedule( string $hook, array $args = array() )
Retrieve the recurrence schedule for an event.
Description
See also
wp_get_schedules(): for available schedules.
Parameters
- $hook
-
(string) (Required) Action hook to identify the event.
- $args
-
(array) (Optional) Arguments passed to the event's callback function.
Default value: array()
Return
(string|false) False, if no schedule. Schedule name on success.
Source
File: wp-includes/cron.php
function wp_get_schedule($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 $cron[$hook][$key]['schedule'];
}
return false;
}
Changelog
Version | Description |
---|---|
WP-2.1.0 | Introduced. |