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. Built from https://develop.svn.wordpress.org/trunk@51985 git-svn-id: http://core.svn.wordpress.org/trunk@51574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
43644069ea
commit
88e9e36233
|
@ -107,10 +107,30 @@ $screen->add_help_tab(
|
|||
|
||||
unset( $help );
|
||||
|
||||
$wp_version = get_bloginfo( 'version', 'display' );
|
||||
$is_dev_version = preg_match( '/alpha|beta|RC/', $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
|
||||
);
|
||||
}
|
||||
|
||||
$screen->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="https://wordpress.org/support/article/dashboard-screen/">Documentation on Dashboard</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
|
||||
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' .
|
||||
'<p>' . $wp_version_text . '</p>'
|
||||
);
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51984';
|
||||
$wp_version = '5.9-alpha-51985';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue