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. git-svn-id: https://develop.svn.wordpress.org/trunk@49292 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1e85024fb4
commit
d92d1bb863
@ -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
|
||||
) {
|
||||
|
@ -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(),
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user