X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..refs/tags/wordpress-4.4.1:/wp-includes/update.php diff --git a/wp-includes/update.php b/wp-includes/update.php index b2dd6c6e..100f77d8 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -646,19 +646,8 @@ function wp_schedule_update_checks() { if ( ! wp_next_scheduled( 'wp_update_themes' ) && ! wp_installing() ) wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); - if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! wp_installing() ) { - // Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site. - $next = strtotime( 'today 7am' ); - $now = time(); - // Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now. - while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) { - $next += 12 * HOUR_IN_SECONDS; - } - $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS; - // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour - $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS; - wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' ); - } + if ( ( wp_next_scheduled( 'wp_maybe_auto_update' ) > ( time() + HOUR_IN_SECONDS ) ) && ! wp_installing() ) + wp_clear_scheduled_hook( 'wp_maybe_auto_update' ); } /**