General: use get_bloginfo( 'version' ) instead of global $wp_version in several locations - excluding those locations which reload version.php mid-flight.

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38459 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2016-08-31 05:48:49 +00:00
parent 2078dda129
commit 1825eff382
22 changed files with 51 additions and 107 deletions
+7 -11
View File
@@ -26,16 +26,17 @@ if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes'
*
* @global string $wp_local_package
* @global wpdb $wpdb
* @global string $wp_version
*
* @staticvar bool $first_pass
*
* @param object $update
*/
function list_core_update( $update ) {
global $wp_local_package, $wpdb, $wp_version;
global $wp_local_package, $wpdb;
static $first_pass = true;
$wp_version = get_bloginfo( 'version' );
if ( 'en_US' == $update->locale && 'en_US' == get_locale() )
$version_string = $update->current;
// If the only available update is a partial builds, it doesn't need a language-specific version string.
@@ -149,13 +150,13 @@ function dismissed_updates() {
*
* @since 2.7.0
*
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
*/
function core_upgrade_preamble() {
global $wp_version, $required_php_version, $required_mysql_version;
global $required_php_version, $required_mysql_version;
$wp_version = get_bloginfo( 'version' );
$updates = get_core_updates();
if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
@@ -211,14 +212,9 @@ function core_upgrade_preamble() {
dismissed_updates();
}
/**
*
* @global string $wp_version
*/
function list_plugin_updates() {
global $wp_version;
$cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
$wp_version = get_bloginfo( 'version' );
$cur_wp_version = preg_replace( '/-.*$/', '', $wp_version );
require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
$plugins = get_plugin_updates();