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.
Built from https://develop.svn.wordpress.org/trunk@51991


git-svn-id: http://core.svn.wordpress.org/trunk@51580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2021-11-02 21:43:57 +00:00
parent db11516237
commit 3819fa7340
2 changed files with 15 additions and 15 deletions

View File

@ -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.
*/
__( '<a href="%1$s">Version %2$s</a>' ),
esc_url( 'https://wordpress.org/support/wordpress-version/version-' . str_replace( '.', '-', $wp_version ) ),
$wp_version
'<a href="%1$s">%2$s</a>',
$version_url,
$wp_version_text
);
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51990';
$wp_version = '5.9-alpha-51991';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.