Make WordPress Core


Ignore:
Timestamp:
11/02/2021 09:42:44 PM (3 years ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/_index.php

    r51985 r51991  
    108108unset( $help );
    109109
    110 $wp_version     = get_bloginfo( 'version', 'display' );
    111 $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version );
    112 
    113 if ( $is_dev_version ) {
    114     /* translators: %s. The WordPress version. */
    115     $wp_version_text = sprintf( __( 'Version %s' ), $wp_version );
    116 } else {
     110$wp_version = get_bloginfo( 'version', 'display' );
     111/* translators: %s: WordPress version. */
     112$wp_version_text = sprintf( __( 'Version %s' ), $wp_version );
     113$is_dev_version  = preg_match( '/alpha|beta|RC/', $wp_version );
     114
     115if ( ! $is_dev_version ) {
     116    $version_url = sprintf(
     117        /* translators: %s: WordPress version. */
     118        esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
     119        sanitize_title( $wp_version )
     120    );
     121
    117122    $wp_version_text = sprintf(
    118         /*
    119          * translators:
    120          * 1. A link to the changelog ending with the WordPress version where '.' is replaced by '-'.
    121          * 2. The WordPress version.
    122          */
    123         __( '<a href="%1$s">Version %2$s</a>' ),
    124         esc_url( 'https://wordpress.org/support/wordpress-version/version-' . str_replace( '.', '-', $wp_version ) ),
    125         $wp_version
     123        '<a href="%1$s">%2$s</a>',
     124        $version_url,
     125        $wp_version_text
    126126    );
    127127}
Note: See TracChangeset for help on using the changeset viewer.