diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 244699c8ed..c4ce866cf6 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -20,10 +20,11 @@ * @param array $args Optional. Arguments to pass to the hook's callback function. */ function wp_schedule_single_event( $timestamp, $hook, $args = array()) { - // don't schedule a duplicate if there's already an identical event due in the next 10 minutes + // don't schedule a duplicate if there's already an identical event due within 10 minutes of it $next = wp_next_scheduled($hook, $args); - if ( $next && $next <= $timestamp + 10 * MINUTE_IN_SECONDS ) + if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) { return; + } $crons = _get_cron_array(); $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args );