Make WordPress Core

Ticket #31598: patch_31598.diff

File patch_31598.diff, 981 bytes (added by GhostToast, 9 years ago)

Patch of wp-includes/cron.php

  • cron.php

     
    1818 * @param int $timestamp Timestamp for when to run the event.
    1919 * @param string $hook Action hook to execute when cron is run.
    2020 * @param array $args Optional. Arguments to pass to the hook's callback function.
     21 *
     22 * @return bool|null
    2123 */
    2224function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
    2325        // don't schedule a duplicate if there's already an identical event due within 10 minutes of it
    2426        $next = wp_next_scheduled($hook, $args);
    2527        if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) {
    26                 return;
     28                return null;
    2729        }
    2830
    2931        $crons = _get_cron_array();
     
    4648        $crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args );
    4749        uksort( $crons, "strnatcasecmp" );
    4850        _set_cron_array( $crons );
     51
     52        return true;
    4953}
    5054
    5155/**