From d83942aa155a62b4b92a3ec980f3f5b5789ab77a Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Fri, 31 Jul 2020 17:01:16 +0000 Subject: [PATCH] Upgrade/Install: Allow for WordPress.org to remotely disable auto-updates for plugins/themes As auto-updates are rolled out across WordPress.org, the API response can modulate the response, ensuring that a rolled out could be stalled or staggered if needed for security or performance reasons. Fixes #50824. Props dd32, whyisjake, SergeyBiryukov. git-svn-id: https://develop.svn.wordpress.org/trunk@48701 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-automatic-updater.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php index e941f72faf..0862e29984 100644 --- a/src/wp-admin/includes/class-wp-automatic-updater.php +++ b/src/wp-admin/includes/class-wp-automatic-updater.php @@ -170,6 +170,11 @@ class WP_Automatic_Updater { $update = ! empty( $item->autoupdate ); } + // If the `disable_autoupdate` flag is set, override any user-choice, but allow filters. + if ( ! empty( $item->disable_autoupdate ) ) { + $update = $item->disable_autoupdate; + } + /** * Filters whether to automatically update core, a plugin, a theme, or a language. *