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.

git-svn-id: https://develop.svn.wordpress.org/trunk@49245 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-10-20 17:54:50 +00:00
parent 643754dc67
commit 194d32b970
2 changed files with 11 additions and 2 deletions

View File

@@ -136,6 +136,11 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
$post_body = array_merge( $post_body, $extra_stats );
}
// Allow for WP_AUTO_UPDATE_CORE to specify beta/RC releases.
if ( defined( 'WP_AUTO_UPDATE_CORE' ) && in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc' ), true ) ) {
$query['channel'] = WP_AUTO_UPDATE_CORE;
}
$url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
$http_url = $url;
$ssl = wp_http_supports( array( 'ssl' ) );