diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-10 22:19:11 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-10 22:19:11 +0000 |
| commit | 69a120282949dc8a5526a7486751bc07aea44d9d (patch) | |
| tree | 9485c819fbf9b2e118db2267629501ebb00fb0e5 /wp-includes/cron.php | |
| parent | 9c59b9cf9db84c636a7e9b66440bb1dd9ac78be5 (diff) | |
| download | wordpress-mu-69a120282949dc8a5526a7486751bc07aea44d9d.tar.gz wordpress-mu-69a120282949dc8a5526a7486751bc07aea44d9d.tar.xz wordpress-mu-69a120282949dc8a5526a7486751bc07aea44d9d.zip | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@721 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/cron.php')
| -rw-r--r-- | wp-includes/cron.php | 16 |
1 files changed, 11 insertions, 5 deletions
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();
|
