Changeset 42584 for trunk/src/wp-includes/update.php
- Timestamp:
- 01/24/2018 04:16:18 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/update.php
r42343 r42584 174 174 } 175 175 176 $offers = $body['offers']; 176 $offers = $body['offers']; 177 $has_auto_update = false; 177 178 178 179 foreach ( $offers as &$offer ) { … … 208 209 ) 209 210 ); 211 212 if ( 'autoupdate' == $offer->response ) { 213 $has_auto_update = true; 214 } 210 215 } 211 216 … … 230 235 231 236 // Trigger background updates if running non-interactively, and we weren't called from the update handler. 232 if ( $doing_cron && ! doing_action( 'wp_maybe_auto_update' ) ) { 233 do_action( 'wp_maybe_auto_update' ); 237 if ( $doing_cron && $has_auto_update && ! doing_action( 'wp_maybe_auto_update' ) ) { 238 include_once( ABSPATH . '/wp-admin/includes/update.php' ); 239 240 // Only trigger background updates if an acceptable autoupdate is on offer, avoids needless extra API calls. 241 if ( find_core_auto_update() ) { 242 do_action( 'wp_maybe_auto_update' ); 243 } 234 244 } 235 245 } … … 288 298 default: 289 299 if ( $doing_cron ) { 290 $timeout = 0;300 $timeout = 2 * HOUR_IN_SECONDS; 291 301 } else { 292 302 $timeout = 12 * HOUR_IN_SECONDS; … … 475 485 break; 476 486 default: 477 $timeout = $doing_cron ? 0 : 12 * HOUR_IN_SECONDS; 487 if ( $doing_cron ) { 488 $timeout = 2 * HOUR_IN_SECONDS; 489 } else { 490 $timeout = 12 * HOUR_IN_SECONDS; 491 } 478 492 } 479 493
Note: See TracChangeset
for help on using the changeset viewer.