WordPress.org

Make WordPress Core

Changeset 50082


Ignore:
Timestamp:
01/30/2021 10:32:10 AM (10 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-core-upgrader.php

    r49587 r50082  
    284284        $upgrade_major = get_site_option( 'auto_update_core_major', 'unset' ) === 'enabled';
    285285
    286         // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false.
     286        // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'development', 'branch-development', 'minor', false.
    287287        if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
    288288            if ( false === WP_AUTO_UPDATE_CORE ) {
     
    292292                $upgrade_major = false;
    293293            } elseif ( true === WP_AUTO_UPDATE_CORE
    294                 || 'beta' === WP_AUTO_UPDATE_CORE
    295                 || 'rc' === WP_AUTO_UPDATE_CORE
     294                || in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
    296295            ) {
    297296                // ALL updates for core.
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r50049 r50082  
    2828    public function run_tests() {
    2929        $tests = array(
    30             $this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'beta', 'rc', 'minor' ) ),
     30            $this->test_constants( 'WP_AUTO_UPDATE_CORE', array( true, 'beta', 'rc', 'development', 'branch-development', 'minor' ) ),
    3131            $this->test_wp_version_check_attached(),
    3232            $this->test_filters_automatic_updater_disabled(),
  • trunk/src/wp-admin/update-core.php

    r49984 r50082  
    307307
    308308    $can_set_update_option = true;
    309     // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false.
     309    // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'development', 'branch-development', 'minor', false.
    310310    if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
    311311        if ( false === WP_AUTO_UPDATE_CORE ) {
     
    315315            $upgrade_major = false;
    316316        } elseif ( true === WP_AUTO_UPDATE_CORE
    317             || 'beta' === WP_AUTO_UPDATE_CORE
    318             || 'rc' === WP_AUTO_UPDATE_CORE
     317            || in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
    319318        ) {
    320319            // ALL updates for core.
  • trunk/src/wp-includes/update.php

    r49245 r50082  
    137137    }
    138138
    139     // Allow for WP_AUTO_UPDATE_CORE to specify beta/RC releases.
    140     if ( defined( 'WP_AUTO_UPDATE_CORE' ) && in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc' ), true ) ) {
     139    // Allow for WP_AUTO_UPDATE_CORE to specify beta/RC/development releases.
     140    if ( defined( 'WP_AUTO_UPDATE_CORE' )
     141        && in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
     142    ) {
    141143        $query['channel'] = WP_AUTO_UPDATE_CORE;
    142144    }
Note: See TracChangeset for help on using the changeset viewer.