From 87a427d3f0834c704c5ee90e8b1e3211d0383c10 Mon Sep 17 00:00:00 2001 From: Clorith Date: Mon, 28 Jun 2021 23:07:57 +0000 Subject: [PATCH] Site Health: Improve readability of site titles. This splits up the site title for the Site Health tabs to make it more obvious what page a user is viewing, and which tab under that page. It also removes a possible source of warnings if a user tries accessing a tab that does not exist. The introduction of this check for existing tabs also improves the accuracy of the active-tab indicator, ensuring the indicator shows up for the default tab, when no other tab has been selected. Follow-up to [50764]. Props audrasjb, swissspidy. Fixes #53535. Built from https://develop.svn.wordpress.org/trunk@51252 git-svn-id: http://core.svn.wordpress.org/trunk@50861 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/site-health.php | 8 +++++--- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-admin/site-health.php b/wp-admin/site-health.php index 590153a102..9facc1f936 100644 --- a/wp-admin/site-health.php +++ b/wp-admin/site-health.php @@ -36,10 +36,12 @@ $wrapper_classes = array( 'tab-count-' . count( $tabs ), ); +$current_tab = ( isset( $_GET['tab'] ) ? $_GET['tab'] : '' ); + $title = sprintf( // translators: %s: The currently displayed tab. - __( 'Site Health %s' ), - ( isset( $_GET['tab'] ) ? esc_html( $tabs[ $_GET['tab'] ] ) : esc_html( reset( $tabs ) ) ) + __( 'Site Health - %s' ), + ( isset( $tabs[ $current_tab ] ) ? esc_html( $tabs[ $current_tab ] ) : esc_html( reset( $tabs ) ) ) ); if ( ! current_user_can( 'view_site_health_checks' ) ) { @@ -133,7 +135,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; admin_url( 'site-health.php' ) ) ), - ( isset( $_GET['tab'] ) && $_GET['tab'] === $slug ? 'active' : '' ), + ( $current_tab === $slug ? 'active' : '' ), esc_html( $label ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 90c9a3769c..c662274e91 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta4-51251'; +$wp_version = '5.8-beta4-51252'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.