WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4/src/wp-includes/update.php

    r35774 r36184  
    647647        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
    648648
    649     if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! wp_installing() ) {
    650         // Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site.
    651         $next = strtotime( 'today 7am' );
    652         $now = time();
    653         // Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now.
    654         while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) {
    655             $next += 12 * HOUR_IN_SECONDS;
    656         }
    657         $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
    658         // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour
    659         $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS;
    660         wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' );
    661     }
     649    if ( ( wp_next_scheduled( 'wp_maybe_auto_update' ) > ( time() + HOUR_IN_SECONDS ) ) && ! wp_installing() )
     650        wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
    662651}
    663652
Note: See TracChangeset for help on using the changeset viewer.