WordPress.org

Make WordPress Core

Ticket #22704: 22704.3.diff

File 22704.3.diff, 1.7 KB (added by johnbillion, 5 years ago)
  • wp-admin/includes/class-wp-upgrader.php

    diff --git wp-admin/includes/class-wp-upgrader.php wp-admin/includes/class-wp-upgrader.php
    index 51aa97c..3373223 100644
    class WP_Automatic_Upgrader { 
    14691469
    14701470        static $upgrade_results = array();
    14711471
    1472         static function upgrader_disabled() {
     1472        static function upgrader_enabled() {
    14731473                // That's a no if you don't want files changes
    14741474                if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
    1475                         return true;
     1475                        return false;
    14761476
    14771477                // More fine grained control can be done through the WP_AUTO_UPDATE_CORE constant and filters
    14781478                if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) && AUTOMATIC_UPDATER_DISABLED )
    1479                         return true;
     1479                        return false;
    14801480
    14811481                if ( defined( 'WP_INSTALLING' ) )
    1482                         return true;
     1482                        return false;
    14831483
    1484                 return apply_filters( 'auto_upgrader_disabled', false );
     1484                return apply_filters( 'auto_upgrader_enabled', true );
    14851485        }
    14861486
    14871487        /**
    class WP_Automatic_Upgrader { 
    15101510         */
    15111511        static function should_auto_update( $type, $item, $context ) {
    15121512
    1513                 if ( self::upgrader_disabled() )
     1513                if ( !self::upgrader_enabled() )
    15141514                        return false;
    15151515
    15161516                if ( self::is_vcs_checkout( $context ) )
  • wp-includes/update.php

    diff --git wp-includes/update.php wp-includes/update.php
    index 79903f5..b9c5e8a 100644
    function wp_auto_updates_maybe_update() { 
    398398        include_once ABSPATH . '/wp-admin/includes/admin.php';
    399399        include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
    400400
    401         if ( WP_Automatic_Upgrader::upgrader_disabled() )
     401        if ( !WP_Automatic_Upgrader::upgrader_enabled() )
    402402                return;
    403403
    404404        WP_Automatic_Upgrader::perform_auto_updates();