diff --git a/src/wp-admin/includes/class-core-upgrader.php b/src/wp-admin/includes/class-core-upgrader.php index 4184bc8ea9..fc6390aa18 100644 --- a/src/wp-admin/includes/class-core-upgrader.php +++ b/src/wp-admin/includes/class-core-upgrader.php @@ -283,14 +283,18 @@ class Core_Upgrader extends WP_Upgrader { $upgrade_minor = true; $upgrade_major = false; - // WP_AUTO_UPDATE_CORE = true (all), 'minor', 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; diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index a946523d03..c632b8405a 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -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' ) );