Changeset 36180 for trunk/src/wp-includes/update.php
- Timestamp:
- 01/06/2016 06:11:46 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/update.php
r36074 r36180 170 170 } 171 171 172 // Trigger a background updates checkif running non-interactively, and we weren't called from the update handler.172 // Trigger background updates if running non-interactively, and we weren't called from the update handler. 173 173 if ( defined( 'DOING_CRON' ) && DOING_CRON && ! doing_action( 'wp_maybe_auto_update' ) ) { 174 174 do_action( 'wp_maybe_auto_update' ); … … 648 648 if ( ! wp_next_scheduled( 'wp_update_themes' ) && ! wp_installing() ) 649 649 wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); 650 651 if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! wp_installing() ) {652 // Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site.653 $next = strtotime( 'today 7am' );654 $now = time();655 // Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now.656 while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) {657 $next += 12 * HOUR_IN_SECONDS;658 }659 $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;660 // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour661 $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS;662 wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' );663 }664 650 } 665 651
Note: See TracChangeset
for help on using the changeset viewer.