Ticket #31598: patch_31598.diff
File patch_31598.diff, 981 bytes (added by , 10 years ago) |
---|
-
cron.php
18 18 * @param int $timestamp Timestamp for when to run the event. 19 19 * @param string $hook Action hook to execute when cron is run. 20 20 * @param array $args Optional. Arguments to pass to the hook's callback function. 21 * 22 * @return bool|null 21 23 */ 22 24 function wp_schedule_single_event( $timestamp, $hook, $args = array()) { 23 25 // don't schedule a duplicate if there's already an identical event due within 10 minutes of it 24 26 $next = wp_next_scheduled($hook, $args); 25 27 if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) { 26 return ;28 return null; 27 29 } 28 30 29 31 $crons = _get_cron_array(); … … 46 48 $crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args ); 47 49 uksort( $crons, "strnatcasecmp" ); 48 50 _set_cron_array( $crons ); 51 52 return true; 49 53 } 50 54 51 55 /**