From 69a120282949dc8a5526a7486751bc07aea44d9d Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 10 Aug 2006 22:19:11 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@721 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/cron.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'wp-includes/cron.php') diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 2edb7ab..116a24a 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -50,17 +50,23 @@ function wp_unschedule_event( $timestamp, $hook ) { } function wp_clear_scheduled_hook( $hook ) { - while ( $timestamp = wp_next_scheduled( $hook ) ) + $args = array_slice( func_get_args(), 1 ); + + while ( $timestamp = wp_next_scheduled( $hook, $args ) ) wp_unschedule_event( $timestamp, $hook ); } -function wp_next_scheduled( $hook ) { +function wp_next_scheduled( $hook, $args = '' ) { $crons = get_option( 'cron' ); if ( empty($crons) ) return false; foreach ( $crons as $timestamp => $cron ) - if ( isset( $cron[$hook] ) ) - return $timestamp; + if ( isset( $cron[$hook] ) ) { + if ( empty($args) ) + return $timestamp; + if ( $args == $cron[$hook]['args'] ) + return $timestamp; + } return false; } @@ -92,7 +98,7 @@ function wp_cron() { return; $keys = array_keys( $crons ); - if ( array_shift( $keys ) > time() ) + if ( $keys[0] > time() ) return; $schedules = wp_get_schedules(); -- cgit