From f517634e28f736b34f0153953bd7341f613d1354 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 12 Nov 2020 20:19:46 +0000 Subject: [PATCH] Upgrade/Install: Enable all core autoupdates for new installs. Likely needs more work for multisite installs. Reference: https://make.wordpress.org/core/2020/11/10/wp5-6-auto-update-implementation-change/ Props audrasjb, azaozz. See #51743. git-svn-id: https://develop.svn.wordpress.org/trunk@49581 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/schema.php | 7 +++++++ src/wp-admin/includes/upgrade.php | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index d48846f739..a59c7c36ce 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -535,6 +535,13 @@ function populate_options( array $options = array() ) { 'disallowed_keys' => '', 'comment_previously_approved' => 1, 'auto_plugin_theme_update_emails' => array(), + + // 5.6.0 + 'auto_update_core_dev' => 'enabled', + 'auto_update_core_minor' => 'enabled', + // Default to enabled for new installs. + // See https://core.trac.wordpress.org/ticket/51742. + 'auto_update_core_major' => 'enabled', ); // 3.3.0 diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 3342c76b65..ca95940b49 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -2255,6 +2255,11 @@ function upgrade_560() { if ( ! is_null( $post_category_exists ) ) { $wpdb->query( "ALTER TABLE $wpdb->posts DROP COLUMN `post_category`" ); } + + // When upgrading from WP < 5.6.0 set the core major auto-updates option to `unset` by default. + // This overrides the same option from populate_options() that is intended for new installs. + // See https://core.trac.wordpress.org/ticket/51742. + update_option( 'auto_update_core_major', 'unset' ); } /**