Make WordPress Core


Ignore:
Timestamp:
03/15/2019 02:53:18 PM (6 years 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/credits.php

    r44562 r44905  
    2525<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    2626
    27 <h2 class="nav-tab-wrapper wp-clearfix">
     27<nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
    2828    <a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
    2929    <a href="credits.php" class="nav-tab nav-tab-active"><?php _e( 'Credits' ); ?></a>
    3030    <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
    3131    <a href="freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
    32 </h2>
     32</nav>
    3333
    3434<div class="about-wrap-content">
     
    7373        }
    7474
    75         echo '<h3 class="wp-people-group">' . esc_html( $title ) . "</h3>\n";
     75        echo '<h2 class="wp-people-group">' . esc_html( $title ) . "</h2>\n";
    7676    }
    7777
Note: See TracChangeset for help on using the changeset viewer.