Make WordPress Core

Ticket #51827: 51827.2.patch

File 51827.2.patch, 1.8 KB (added by azaozz, 4 years ago)
  • src/wp-admin/update-core.php

     
    291291                }
    292292        }
    293293
     294        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     295        $updater = new WP_Automatic_Updater();
     296
    294297        // Defaults:
    295298        $upgrade_dev   = get_site_option( 'auto_update_core_dev', 'enabled' ) === 'enabled';
    296299        $upgrade_minor = get_site_option( 'auto_update_core_minor', 'enabled' ) === 'enabled';
     
    323326                $can_set_update_option = false;
    324327        }
    325328
    326         if ( defined( 'AUTOMATIC_UPDATER_DISABLED' )
    327                 || has_filter( 'automatic_updater_disabled' )
    328         ) {
    329                 if ( true === AUTOMATIC_UPDATER_DISABLED
    330                         /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    331                         || true === apply_filters( 'automatic_updater_disabled', false )
    332                 ) {
    333                         $upgrade_dev   = false;
    334                         $upgrade_minor = false;
    335                         $upgrade_major = false;
    336                 }
    337                 // The UI is overridden by the AUTOMATIC_UPDATER_DISABLED constant.
     329        if ( $updater->is_disabled() ) {
     330                $upgrade_dev   = false;
     331                $upgrade_minor = false;
     332                $upgrade_major = false;
     333
     334                // The UI is overridden by the AUTOMATIC_UPDATER_DISABLED constant
     335                // or the automatic_updater_disabled filter,
     336                // or by wp_is_file_mod_allowed( 'automatic_updater' ).
     337                // See WP_Automatic_Updater::is_disabled().
    338338                $can_set_update_option = false;
    339339        }
    340340
     
    370370
    371371        <p class="auto-update-status">
    372372                <?php
    373                 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    374                 $updater = new WP_Automatic_Updater();
     373
    375374                if ( $updater->is_vcs_checkout( ABSPATH ) ) {
    376375                        _e( 'This site appears to be under version control. Automatic updates are disabled.' );
    377376                } elseif ( $upgrade_major ) {