WordPress.org

Make WordPress Core

Changeset 51985


Ignore:
Timestamp:
11/02/2021 07:07:10 PM (3 months ago)
Author:
johnjamesjacoby
Message:

Help/About: add WordPress version to contextual "Help" sidebar area.

This change adds a new way for users to quickly identify what version of WordPress they are looking at, directly from the "Help" sidebar on the main "Dashboard" page.

  • Stable versions will link to their respective support documents.
  • Development versions (alpha/beta/RC) will not link anywhere.

Props audrasjb, costdev, donmhico, hellofromtonya, ipstenu, justinahinon, karmatosed, knutsp, marybaum, sergeybiryukov, webcommsat.

Fixes #47848.

File:
1 edited

Legend:

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

    r51475 r51985  
    108108unset( $help );
    109109
     110$wp_version     = get_bloginfo( 'version', 'display' );
     111$is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version );
     112
     113if ( $is_dev_version ) {
     114    /* translators: %s. The WordPress version. */
     115    $wp_version_text = sprintf( __( 'Version %s' ), $wp_version );
     116} else {
     117    $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
     126    );
     127}
     128
    110129$screen->set_help_sidebar(
    111130    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    112131    '<p>' . __( '<a href="https://wordpress.org/support/article/dashboard-screen/">Documentation on Dashboard</a>' ) . '</p>' .
    113     '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
     132    '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' .
     133    '<p>' . $wp_version_text . '</p>'
    114134);
    115135
Note: See TracChangeset for help on using the changeset viewer.