Make WordPress Core


Ignore:
Timestamp:
04/17/2021 10:53:04 AM (4 years ago)
Author:
Clorith
Message:

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.

File:
1 edited

Legend:

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

    r50764 r50765  
    4040    // translators: %s: The currently displayed tab.
    4141    __( 'Site Health %s' ),
    42     ( isset( $_GET['tab'] ) ? esc_html( $tabs[ $_GET['tab'] ] ) : esc_html( $tabs[0] ) )
     42    ( isset( $_GET['tab'] ) ? esc_html( $tabs[ $_GET['tab'] ] ) : esc_html( reset( $tabs ) ) )
    4343);
    4444
Note: See TracChangeset for help on using the changeset viewer.