From 7b0088c9383729528ff519621e1039a49d03dbbc Mon Sep 17 00:00:00 2001
From: Andrew Nacin
Date: Tue, 15 Oct 2013 05:08:09 +0000
Subject: [PATCH] Hide language-specific warnings/labels on update-core.php
when we are dealing with a point release partial build.
see #22704, #18200.
Built from https://develop.svn.wordpress.org/trunk@25784
git-svn-id: http://core.svn.wordpress.org/trunk@25697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/update-core.php | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php
index 16020320f3..39cf45a167 100644
--- a/wp-admin/update-core.php
+++ b/wp-admin/update-core.php
@@ -22,11 +22,17 @@ if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes'
wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
function list_core_update( $update ) {
- global $wp_local_package, $wpdb;
- static $first_pass = true;
-
- $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
- $update->current : sprintf("%s–%s", $update->current, $update->locale);
+ global $wp_local_package, $wpdb, $wp_version;
+ static $first_pass = true;
+
+ 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.
+ elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) )
+ $version_string = $update->current;
+ else
+ $version_string = sprintf( "%s–%s", $update->current, $update->locale );
+
$current = false;
if ( !isset($update->response) || 'latest' == $update->response )
$current = true;
@@ -89,7 +95,8 @@ function list_core_update( $update ) {
echo '
';
if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
echo ''.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'
';
- else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
+ // Partial builds don't need language-specific warnings.
+ elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
echo ''.sprintf( __('You are about to install WordPress %s in English (US). There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->response != 'development' ? $update->current : '' ).'
';
}
echo '';