From fa5a9d5e9200056dd5a010e4355da1b7728d9af9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 8 Mar 2021 11:31:09 +0000 Subject: [PATCH] Upgrade/Install: Display version number on the "Update now" button on WordPress Updates screen. Additionally, adjust the "Update to latest nightly" button to include the major version number of the nightly build. This makes the button labels more accurate and provides more clear understanding of what the update will be. Follow-up to [49984]. Props afragen, pbiron, SergeyBiryukov. Fixes #52513. Built from https://develop.svn.wordpress.org/trunk@50506 git-svn-id: http://core.svn.wordpress.org/trunk@50119 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/update-core.php | 14 +++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 35ae406799..2e9483517e 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -55,15 +55,23 @@ function list_core_update( $update ) { $current = true; } - $is_development_version = preg_match( '/alpha|beta|RC/', $version_string ); - $message = ''; - $submit = $is_development_version ? __( 'Update to latest nightly' ) : __( 'Update now' ); $form_action = 'update-core.php?action=do-core-upgrade'; $php_version = phpversion(); $mysql_version = $wpdb->db_version(); $show_buttons = true; + // Nightly build versions have two hyphens and a commit number. + if ( preg_match( '/-\w+-\d+/', $update->current ) ) { + // Retrieve the major version number. + preg_match( '/^\d+.\d+/', $update->current, $update_major ); + /* translators: %s: WordPress version. */ + $submit = sprintf( __( 'Update to latest %s nightly' ), $update_major[0] ); + } else { + /* translators: %s: WordPress version. */ + $submit = sprintf( __( 'Update to version %s' ), $version_string ); + } + if ( 'development' === $update->response ) { $message = __( 'You can update to the latest nightly build manually:' ); } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index 194e1c5405..8572319bb8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50505'; +$wp_version = '5.8-alpha-50506'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.