WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/15/2019 02:53:18 PM (13 months ago)
Author:
afercia
Message:

Accessibility: Improve the semantics of "tabs" that are not real ARIA tabs.

Some "visual tabs" in the WordPress admin used links wrapped in a h2 heading. While these tabs look like ARIA tabs, they're just navigation menus and should be marked-up as such to be correctly exposed to assistive technologies.

  • changes the wrapping <h2> to a <nav> element: worth reminding <nav> elements also define ARIA landmarks
  • adds an aria-label to the <nav> elements so they can be distinguished from other <nav> elements in the page
  • adjusts the headings level in the Credits page

Props audrasjb, afercia.
Fixes #43398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r44574 r44905  
    11311131
    11321132    // All done!
    1133     echo '<h2 class="nav-tab-wrapper wp-clearfix">';
     1133    echo '<nav class="nav-tab-wrapper wp-clearfix" aria-label="' . esc_attr__( 'Secondary menu' ) . '">';
    11341134    echo implode( '', $screen_links );
    1135     echo '</h2>';
     1135    echo '</nav>';
    11361136}
    11371137
Note: See TracChangeset for help on using the changeset viewer.