Make WordPress Core

Ticket #51827: 51827.patch

File 51827.patch, 1.3 KB (added by jamesros161, 4 years ago)

Proposed patch

  • src/wp-admin/update-core.php

     
    323323                $can_set_update_option = false;
    324324        }
    325325
    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 )
     326        if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) && true === AUTOMATIC_UPDATER_DISABLED
     327                || has_filter( 'automatic_updater_disabled' ) && true === apply_filters( 'automatic_updater_disabled', false )
    332328                ) {
    333329                        $upgrade_dev   = false;
    334330                        $upgrade_minor = false;
    335331                        $upgrade_major = false;
    336                 }
    337                 // The UI is overridden by the AUTOMATIC_UPDATER_DISABLED constant.
    338                 $can_set_update_option = false;
    339         }
     332                } else if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) || has_filter( 'automatic_updater_disabled' ) ) {
     333                        // The UI is overridden by the AUTOMATIC_UPDATER_DISABLED constant.
     334                        $can_set_update_option = false;
     335        }
    340336
    341337        // Is the UI overridden by a plugin using the allow_major_auto_core_updates filter?
    342338        if ( has_filter( 'allow_major_auto_core_updates' ) ) {