WordPress.org

Make WordPress Core

Changeset 49245


Ignore:
Timestamp:
10/20/2020 05:54:50 PM (14 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Allow WordPress sites to opt-in to beta & RC releases.

The WP_AUTO_UPDATE_CORE constant now supports beta and rc values.

This makes it possible for sites to opt-in to updating to RC (or beta) releases without having to install a plugin, or run on a development version.

Props dd32, knutsp.
Fixes #51319.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r49028 r49245  
    284284        $upgrade_major = false;
    285285
    286         // WP_AUTO_UPDATE_CORE = true (all), 'minor', false.
     286        // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false.
    287287        if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
    288288            if ( false === WP_AUTO_UPDATE_CORE ) {
     
    291291                $upgrade_minor = false;
    292292                $upgrade_major = false;
    293             } elseif ( true === WP_AUTO_UPDATE_CORE ) {
     293            } elseif (
     294                true === WP_AUTO_UPDATE_CORE
     295                || 'beta' === WP_AUTO_UPDATE_CORE
     296                || 'rc' === WP_AUTO_UPDATE_CORE
     297            ) {
    294298                // ALL updates for core.
    295299                $upgrade_dev   = true;
  • trunk/src/wp-includes/update.php

    r49108 r49245  
    135135    if ( is_array( $extra_stats ) ) {
    136136        $post_body = array_merge( $post_body, $extra_stats );
     137    }
     138
     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 ) ) {
     141        $query['channel'] = WP_AUTO_UPDATE_CORE;
    137142    }
    138143
Note: See TracChangeset for help on using the changeset viewer.