mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-11 05:50:11 +00:00
Upgrade/Install: Allow WordPress sites to opt-in to development releases.
The `WP_AUTO_UPDATE_CORE` constant now supports `development` and `branch-development` values. This makes it possible for sites to opt-in to updating to nightly builds without having to install a plugin. Follow-up to [49245], [49292]. Props xkon, knutsp, afragen, audrasjb, dd32. Fixes #51978. git-svn-id: https://develop.svn.wordpress.org/trunk@50082 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -283,7 +283,7 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
$upgrade_minor = get_site_option( 'auto_update_core_minor', 'enabled' ) === 'enabled';
|
||||
$upgrade_major = get_site_option( 'auto_update_core_major', 'unset' ) === 'enabled';
|
||||
|
||||
// WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false.
|
||||
// WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'development', 'branch-development', 'minor', false.
|
||||
if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
|
||||
if ( false === WP_AUTO_UPDATE_CORE ) {
|
||||
// Defaults to turned off, unless a filter allows it.
|
||||
@@ -291,8 +291,7 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
$upgrade_minor = false;
|
||||
$upgrade_major = false;
|
||||
} elseif ( true === WP_AUTO_UPDATE_CORE
|
||||
|| 'beta' === WP_AUTO_UPDATE_CORE
|
||||
|| 'rc' === WP_AUTO_UPDATE_CORE
|
||||
|| in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
|
||||
) {
|
||||
// ALL updates for core.
|
||||
$upgrade_dev = true;
|
||||
|
||||
@@ -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, 'beta', 'rc', 'minor' ) ),
|
||||
$this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'beta', 'rc', 'development', 'branch-development', 'minor' ) ),
|
||||
$this->test_wp_version_check_attached(),
|
||||
$this->test_filters_automatic_updater_disabled(),
|
||||
$this->test_wp_automatic_updates_disabled(),
|
||||
|
||||
Reference in New Issue
Block a user