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/freedoms.php

    r44264 r44905  
    3535<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    3636
    37 <h2 class="nav-tab-wrapper wp-clearfix">
     37<nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
    3838    <a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
    3939    <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a>
    4040    <a href="freedoms.php" class="nav-tab<?php echo $freedoms_class; ?>"><?php _e( 'Freedoms' ); ?></a>
    4141    <a href="freedoms.php?privacy-notice" class="nav-tab<?php echo $privacy_class; ?>"><?php _e( 'Privacy' ); ?></a>
    42 </h2>
     42</nav>
    4343
    4444<?php if ( $is_privacy_notice ) : ?>
Note: See TracChangeset for help on using the changeset viewer.