wp_get_schedule() from masquerade.

git-svn-id: https://develop.svn.wordpress.org/trunk@4254 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-09-26 01:14:49 +00:00
parent 52a2f4a6e1
commit ea94ff906d

View File

@ -125,6 +125,18 @@ function wp_get_schedules() {
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
}
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;
}
//
// Private functions
//