Update Core UI changes:

* Update Now instead of Update Automatically.
 * The first core update is now a primary button.
 * Hide the version number from the 'You are about to install WP in English' warning for development versions, as it lies and suggests you will be downgraded.
see #10611.


git-svn-id: http://svn.automattic.com/wordpress/trunk@18224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-06-10 05:37:51 +00:00
parent bc7d8a9dca
commit fa2d658ab7
1 changed files with 12 additions and 5 deletions

View File

@ -19,12 +19,14 @@ if ( ! current_user_can( 'update_core' ) )
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&ndash;<strong>%s</strong>", $update->current, $update->locale);
$current = false;
if ( !isset($update->response) || 'latest' == $update->response )
$current = true;
$submit = __('Update Automatically');
$submit = __('Update Now');
$form_action = 'update-core.php?action=do-core-upgrade';
$php_version = phpversion();
$mysql_version = $wpdb->db_version();
@ -35,7 +37,7 @@ function list_core_update( $update ) {
} else {
if ( $current ) {
$message = sprintf(__('You have the latest version of WordPress. You do not need to update. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string);
$submit = __('Re-install Automatically');
$submit = __('Re-install Now');
$form_action = 'update-core.php?action=do-core-reinstall';
} else {
$php_compat = version_compare( $php_version, $update->php_version, '>=' );
@ -63,8 +65,13 @@ function list_core_update( $update ) {
echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>';
echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>';
if ( $show_buttons ) {
submit_button( $submit, 'button', 'upgrade', false );
echo '&nbsp;<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a>&nbsp;';
if ( $first_pass ) {
submit_button( $submit, 'button button-primary', 'upgrade', false );
$first_pass = false;
} else {
submit_button( $submit, 'button', 'upgrade', false );
}
echo '&nbsp;<a href="' . esc_url( $update->package ) . '" class="button">' . $download . '</a>&nbsp;';
}
if ( 'en_US' != $update->locale )
if ( !isset( $update->dismissed ) || !$update->dismissed )
@ -75,7 +82,7 @@ function list_core_update( $update ) {
if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English (US).</strong> 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 : '' ).'</p>';
}
echo '</form>';