Make WordPress Core


Ignore:
Timestamp:
01/23/2015 06:17:25 PM (10 years ago)
Author:
jorbin
Message:

Improve accessibility of nav menu locations form.

A couple of small tweaks to the nav menu locations form that make it friendlier to assistive technology. These include:

  • labels for selects
  • better context for the "Edit" link. We hide "edit" from screen readers and instead give them a phrase with context since they may not be able to take advantage of the visual context

Additionally, there are some minor css tweaks to improve the visual alignment of the rows.
We also remove duplicate IDs and use classes instead.

Props afercia.
fixes #31090.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/nav-menus.php

    r31200 r31272  
    582582                <tbody class="menu-locations">
    583583                <?php foreach ( $locations as $_location => $_name ) { ?>
    584                     <tr id="menu-locations-row">
    585                         <td class="menu-location-title"><strong><?php echo $_name; ?></strong></td>
     584                    <tr class="menu-locations-row">
     585                        <td class="menu-location-title"><label for="locations-<?php echo $_location; ?>"><?php echo $_name; ?></label></td>
    586586                        <td class="menu-location-menus">
    587587                            <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
     
    598598                                <span class="locations-edit-menu-link">
    599599                                    <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => $menu_locations[$_location] ), admin_url( 'nav-menus.php' ) ) ); ?>">
    600                                         <?php _ex( 'Edit', 'menu' ); ?>
     600                                        <span aria-hidden="true"><?php _ex( 'Edit', 'menu' ); ?></span><span class="screen-reader-text"><?php _e( 'Edit selected menu' ); ?></span>
    601601                                    </a>
    602602                                </span>
     
    607607                                    </a>
    608608                                </span>
    609                             </div><!-- #locations-row-links -->
     609                            </div><!-- .locations-row-links -->
    610610                        </td><!-- .menu-location-menus -->
    611                     </tr><!-- #menu-locations-row -->
     611                    </tr><!-- .menu-locations-row -->
    612612                <?php } // foreach ?>
    613613                </tbody>
Note: See TracChangeset for help on using the changeset viewer.