Site Health: Correct array key for the default tab

Use `reset` to get the label from the first tab entry as the default if no tab is defined.
This ensures even if the tab order is changed, or tabs are removed, no warnings will be thrown.

Follow-up to [50764].

See #47225.
Built from https://develop.svn.wordpress.org/trunk@50765


git-svn-id: http://core.svn.wordpress.org/trunk@50374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Clorith 2021-04-17 10:55:03 +00:00
parent eea98a5426
commit 954842868f
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ $wrapper_classes = array(
$title = sprintf(
// translators: %s: The currently displayed tab.
__( 'Site Health %s' ),
( isset( $_GET['tab'] ) ? esc_html( $tabs[ $_GET['tab'] ] ) : esc_html( $tabs[0] ) )
( isset( $_GET['tab'] ) ? esc_html( $tabs[ $_GET['tab'] ] ) : esc_html( reset( $tabs ) ) )
);
if ( ! current_user_can( 'view_site_health_checks' ) ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50764';
$wp_version = '5.8-alpha-50765';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.