[wp-trac] [WordPress Trac] #54631: Auto updates should be able to be switched off

WordPress Trac noreply at wordpress.org
Wed Dec 15 17:18:20 UTC 2021


#54631: Auto updates should be able to be switched off
-----------------------------+------------------------------
 Reporter:  sunflower99      |       Owner:  (none)
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by sunflower99):

 As my answer does not seem to appear within that ticket here again:

 Hello, thanks for the hint. I could get rid of the message evaluating the
 variable in both files, wp-admin/includes/update.php in 2 places:

 {{{#!php
 <?php
 function get_core_updates( $options = array() ) {
 +       if (!defined('WP_AUTO_UPDATE_CORE'))
 +               define('WP_AUTO_UPDATE_CORE', true);
 +       if ( false === WP_AUTO_UPDATE_CORE )
 +               return array();

         $options   = array_merge(
 }}}


 {{{#!php
 <?php
 function maintenance_nag() {

 +       if (!defined('WP_AUTO_UPDATE_CORE'))
 +               define('WP_AUTO_UPDATE_CORE', true);
 +       if ( false === WP_AUTO_UPDATE_CORE )
 +               return array();
 +
 +       // Include an unmodified $wp_version.
 +       require ABSPATH . WPINC . '/version.php';
 }}}


 and wp-admin/update-core.php :

 {{{#!php
 <?php
 function core_upgrade_preamble() {
 +       if (!defined('WP_AUTO_UPDATE_CORE'))
 +                       define('WP_AUTO_UPDATE_CORE', true);
 +
 +       if ( false === WP_AUTO_UPDATE_CORE )
 +               return array();

         global $required_php_version, $required_mysql_version;
 }}}


 Now wordpress does not make any core upgrades in the background and shows
 only
 the actual version without update errors.
 That would be a great benefit for admins who install wordpress from a
 distribution package, because they only update by the specific update
 mechanism
 (apt, yum, ...), not by wordpress itself.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54631#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list