Changeset 36184 for branches/3.9/src/wp-includes/update.php
- Timestamp:
- 01/06/2016 12:23:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/src/wp-includes/update.php
r28145 r36184 612 612 wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); 613 613 614 if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! defined( 'WP_INSTALLING' ) ) { 615 // Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site. 616 $next = strtotime( 'today 7am' ); 617 $now = time(); 618 // Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now. 619 while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) { 620 $next += 12 * HOUR_IN_SECONDS; 621 } 622 $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS; 623 // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour 624 $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS; 625 wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' ); 626 } 614 if ( ( wp_next_scheduled( 'wp_maybe_auto_update' ) > ( time() + HOUR_IN_SECONDS ) ) && ! defined('WP_INSTALLING') ) 615 wp_clear_scheduled_hook( 'wp_maybe_auto_update' ); 627 616 } 628 617
Note: See TracChangeset
for help on using the changeset viewer.