From 5fa673144148e20844dc60de93e905a7c0e71462 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 13 Nov 2020 11:12:55 +0000 Subject: [PATCH] Upgrade/Install: Account for the `automatic_updater_disabled` filter in core auto-update settings UI. Follow-up to [49587]. Props markparnell, audrasjb. See #51742. git-svn-id: https://develop.svn.wordpress.org/trunk@49592 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/update-core.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index fb411ef0b6..dfd7b06a5a 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -348,8 +348,13 @@ function core_auto_updates_settings() { $can_set_update_option = false; } - if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) ) { - if ( true === AUTOMATIC_UPDATER_DISABLED ) { + if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) + || has_filter( 'automatic_updater_disabled' ) + ) { + if ( true === AUTOMATIC_UPDATER_DISABLED + /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */ + || true === apply_filters( 'automatic_updater_disabled', false ) + ) { $upgrade_dev = false; $upgrade_minor = false; $upgrade_major = false;