summaryrefslogtreecommitdiffstats
path: root/wp-includes/cron.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/cron.php')
-rw-r--r--wp-includes/cron.php16
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();