From c77373edce33e302f7ef368fdacdae14d5387bd6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 1 Aug 2020 19:44:09 +0000 Subject: [PATCH] Upgrade/Install: Show the installed WordPress version number on WordPress Updates screen if there is a newer version available. This makes it easier for a user to know how significant of an update the change might be, and helps them make an informed decision about how to proceed. Props tmdesigned, dd32, circlecube, dkarfa, hakre, scribu, MadtownLems, markshep, nbachiyski, dmchale, miqrogroove, ovann86, danieltj, sterndata, seanpaulrasmussen, mrgrt, Commeuneimage, dpacks, puneetsahalot, jonoaldersonwp, SergeyBiryukov. Fixes #15101. See #35554, #47848. git-svn-id: https://develop.svn.wordpress.org/trunk@48709 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/update-core.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index a876d0e384..6a871671ee 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -54,11 +54,13 @@ function list_core_update( $update ) { if ( ! isset( $update->response ) || 'latest' === $update->response ) { $current = true; } + $submit = __( 'Update Now' ); $form_action = 'update-core.php?action=do-core-upgrade'; $php_version = phpversion(); $mysql_version = $wpdb->db_version(); $show_buttons = true; + if ( 'development' === $update->response ) { $message = __( 'You are using a development version of WordPress. You can update to the latest nightly build automatically:' ); } else { @@ -124,12 +126,14 @@ function list_core_update( $update ) { ); } else { $message = sprintf( - /* translators: 1: URL to WordPress release notes, 2: WordPress version number including locale if necessary. */ - __( 'You can update to WordPress %2$s automatically:' ), + /* translators: 1: Installed WordPress version number, 2: URL to WordPress release notes, 3: New WordPress version number, including locale if necessary. */ + __( 'You can update from WordPress %1$s to WordPress %3$s automatically:' ), + $wp_version, $version_url, $version_string ); } + if ( ! $mysql_compat || ! $php_compat ) { $show_buttons = false; } @@ -139,8 +143,10 @@ function list_core_update( $update ) { echo '

'; echo $message; echo '

'; + echo '
'; wp_nonce_field( 'upgrade-core' ); + echo '

'; echo ''; echo ''; @@ -160,6 +166,7 @@ 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.' ) . '

'; } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) { @@ -170,6 +177,7 @@ function list_core_update( $update ) { 'development' !== $update->response ? $update->current : '' ) . '

'; } + echo '
'; }