From 05b44492c84b6de4bc826edf608d4efbd94f18e2 Mon Sep 17 00:00:00 2001 From: "Marius L. J" Date: Sat, 17 Apr 2021 10:53:04 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@50765 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/site-health.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/site-health.php b/src/wp-admin/site-health.php index 6d385a36bf..09661a9e84 100644 --- a/src/wp-admin/site-health.php +++ b/src/wp-admin/site-health.php @@ -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' ) ) {