Upgrade/Install: Account for new `WP_AUTO_UPDATE_CORE` values in auto-updates settings form.

This updates `core_auto_updates_settings()` to account for the new `beta` and `rc` values for the `WP_AUTO_UPDATE_CORE` constant.

Additionally, recognize these new values as acceptable in Site Health tests.

Follow-up to [48804], [49245], [49254].

Fixes #51319. See #50907.
Built from https://develop.svn.wordpress.org/trunk@49292


git-svn-id: http://core.svn.wordpress.org/trunk@49054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-10-24 00:26:05 +00:00
parent e992757e5b
commit bb63c1cbd9
4 changed files with 8 additions and 5 deletions

View File

@ -290,8 +290,7 @@ class Core_Upgrader extends WP_Upgrader {
$upgrade_dev = false;
$upgrade_minor = false;
$upgrade_major = false;
} elseif (
true === WP_AUTO_UPDATE_CORE
} elseif ( true === WP_AUTO_UPDATE_CORE
|| 'beta' === WP_AUTO_UPDATE_CORE
|| 'rc' === WP_AUTO_UPDATE_CORE
) {

View File

@ -27,7 +27,7 @@ class WP_Site_Health_Auto_Updates {
*/
public function run_tests() {
$tests = array(
$this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'minor' ) ),
$this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'beta', 'rc', 'minor' ) ),
$this->test_wp_version_check_attached(),
$this->test_filters_automatic_updater_disabled(),
$this->test_wp_automatic_updates_disabled(),

View File

@ -322,13 +322,17 @@ function core_auto_updates_settings() {
$upgrade_minor = get_site_option( 'auto_update_core_minor', true );
$upgrade_major = get_site_option( 'auto_update_core_major', false );
// WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false.
if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
if ( false === WP_AUTO_UPDATE_CORE ) {
// Defaults to turned off, unless a filter allows it.
$upgrade_dev = false;
$upgrade_minor = false;
$upgrade_major = false;
} elseif ( true === WP_AUTO_UPDATE_CORE ) {
} elseif ( true === WP_AUTO_UPDATE_CORE
|| 'beta' === WP_AUTO_UPDATE_CORE
|| 'rc' === WP_AUTO_UPDATE_CORE
) {
// ALL updates for core.
$upgrade_dev = true;
$upgrade_minor = true;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-beta1-49291';
$wp_version = '5.6-beta1-49292';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.