WordPress.org

WordPress build repository browser

Changeset 42482


Ignore:
Timestamp:
02/06/18 11:04:34 (2 weeks ago)
Author:
dd32
Message:

Updates: Partially revert [42584], as this branch of code should always be run after a core update check.

This code branch is responsible for running all autoupdates, including plugins and themes - which should run regardless of if there's a core autoupdate available.

This revert does not revert the $timeout changes, as these should still use cached data if it's available.
Ideally this should be decoupled from the core update check to allow background updates to operate even when the core update check is disabled or running more often than twice daily.

See #43103.

Built from https://develop.svn.wordpress.org/trunk@42653

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/update.php

    r42413 r42482  
    174174    } 
    175175 
    176     $offers          = $body['offers']; 
    177     $has_auto_update = false; 
     176    $offers = $body['offers']; 
    178177 
    179178    foreach ( $offers as &$offer ) { 
     
    209208            ) 
    210209        ); 
    211  
    212         if ( 'autoupdate' == $offer->response ) { 
    213             $has_auto_update = true; 
    214         } 
    215210    } 
    216211 
     
    235230 
    236231    // Trigger background updates if running non-interactively, and we weren't called from the update handler. 
    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         } 
     232    if ( $doing_cron && ! doing_action( 'wp_maybe_auto_update' ) ) { 
     233        do_action( 'wp_maybe_auto_update' ); 
    244234    } 
    245235} 
  • trunk/wp-includes/version.php

    r42481 r42482  
    55 * @global string $wp_version 
    66 */ 
    7 $wp_version = '5.0-alpha-42652'; 
     7$wp_version = '5.0-alpha-42653'; 
    88 
    99/** 
Note: See TracChangeset for help on using the changeset viewer.