Make WordPress Core

Changeset 30393


Ignore:
Timestamp:
11/19/2014 07:36:43 PM (12 years ago)
Author:
helen
Message:

Accessibility: hide admin menu separators from screen readers.

props afercia. fixes #30010.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu-header.php

    r29206 r30393  
    5353                $class = array();
    5454                $aria_attributes = '';
     55                $aria_hidden = '';
     56                $is_separator = false;
    5557
    5658                if ( $first ) {
    … …  
    8082                $img = $img_style = '';
    8183                $img_class = ' dashicons-before';
     84
     85                if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
     86                        $is_separator = true;
     87                }
    8288
    8389                /*
    … …  
    105111                $title = wptexturize( $item[0] );
    106112
    107                 echo "\n\t<li$class$id>";
    108 
    109                 if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
     113                // hide separators from screen readers
     114                if ( $is_separator ) {
     115                        $aria_hidden = ' aria-hidden="true"';
     116                }
     117
     118                echo "\n\t<li$class$id$aria_hidden>";
     119
     120                if ( $is_separator ) {
    110121                        echo '<div class="separator"></div>';
    111122                } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) {
Note: See TracChangeset for help on using the changeset viewer.