From 032b98dbdd56cdea42d71bf2bb99b2adc7e3e236 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 2 Nov 2021 21:42:44 +0000 Subject: [PATCH] Help/About: Simplifies WordPress version in "Help" sidebar. Simplifies the logic for when not in alpha/beta/RC. The changelog URL is translatable in a few other places in core. This commit uses the same pattern for consistency. Follow-up to [51985]. Props sergeybiryukov. Fixes #47848. git-svn-id: https://develop.svn.wordpress.org/trunk@51991 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/_index.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/wp-admin/_index.php b/src/wp-admin/_index.php index b21f7d7ce4..80e3f25031 100644 --- a/src/wp-admin/_index.php +++ b/src/wp-admin/_index.php @@ -107,22 +107,22 @@ $screen->add_help_tab( unset( $help ); -$wp_version = get_bloginfo( 'version', 'display' ); -$is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); +$wp_version = get_bloginfo( 'version', 'display' ); +/* translators: %s: WordPress version. */ +$wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); +$is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); + +if ( ! $is_dev_version ) { + $version_url = sprintf( + /* translators: %s: WordPress version. */ + esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), + sanitize_title( $wp_version ) + ); -if ( $is_dev_version ) { - /* translators: %s. The WordPress version. */ - $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); -} else { $wp_version_text = sprintf( - /* - * translators: - * 1. A link to the changelog ending with the WordPress version where '.' is replaced by '-'. - * 2. The WordPress version. - */ - __( 'Version %2$s' ), - esc_url( 'https://wordpress.org/support/wordpress-version/version-' . str_replace( '.', '-', $wp_version ) ), - $wp_version + '%2$s', + $version_url, + $wp_version_text ); }