Make WordPress Core


Ignore:
Timestamp:
01/22/2016 02:25:58 PM (8 years ago)
Author:
afercia
Message:

Accessibility: Remove title attributes from the Menus screen.

Also, adds missing labels and improves the existing ones.
Updates the "custom links" labels and inputs in the Customizer too.
Introduces a generic, reusable, .wp-initial-focus CSS class to be used for
the sole purpose of setting the initial focus.
"Quick Search": uniform the attached events and avoids new AJAX requests to
be triggered when the pressed key doesn't change the searched term.

Fixes #35374.

File:
1 edited

Legend:

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

    r36171 r36379  
    737737                    wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' );
    738738
    739                     if ( $one_theme_location_no_menus ) { ?>
     739                    $menu_name_aria_desc = $add_new_screen ? ' aria-describedby="menu-name-desc"' : '';
     740
     741                    if ( $one_theme_location_no_menus ) {
     742                        $menu_name_val = 'value="' . esc_attr( 'Menu 1' ) . '"';
     743                    ?>
    740744                        <input type="hidden" name="zero-menu-state" value="true" />
    741                     <?php } ?>
     745                    <?php } else {
     746                        $menu_name_val = 'value="' . esc_attr( $nav_menu_selected_title ) . '"';
     747                    } ?>
    742748                    <input type="hidden" name="action" value="update" />
    743749                    <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
    744750                    <div id="nav-menu-header">
    745751                        <div class="major-publishing-actions">
    746                             <label class="menu-name-label howto open-label" for="menu-name">
    747                                 <span><?php _e( 'Menu Name' ); ?></span>
    748                                 <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e( 'Enter menu name here' ); ?>" value="<?php if ( $one_theme_location_no_menus ) _e( 'Menu 1' ); else echo esc_attr( $nav_menu_selected_title ); ?>" />
    749                             </label>
     752                            <label class="menu-name-label" for="menu-name"><?php _e( 'Menu Name' ); ?></label>
     753                            <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox" <?php echo $menu_name_val . $menu_name_aria_desc; ?> />
    750754                            <div class="publishing-action">
    751755                                <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
     
    770774                            <?php endif; ?>
    771775                            <?php if ( $add_new_screen ) : ?>
    772                                 <p class="post-body-plain"><?php _e( 'Give your menu a name above, then click Create Menu.' ); ?></p>
     776                                <p class="post-body-plain" id="menu-name-desc"><?php _e( 'Give your menu a name, then click Create Menu.' ); ?></p>
    773777                                <?php if ( isset( $_GET['use-location'] ) ) : ?>
    774778                                    <input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
     
    802806                                            <label for="locations-<?php echo esc_attr( $location ); ?>"><?php echo $description; ?></label>
    803807                                            <?php if ( ! empty( $menu_locations[ $location ] ) && $menu_locations[ $location ] != $nav_menu_selected_id ) : ?>
    804                                                 <span class="theme-location-set"><?php 
     808                                                <span class="theme-location-set"><?php
    805809                                                    /* translators: %s: menu name */
    806810                                                    printf( _x( '(Currently set to: %s)', 'menu location' ),
Note: See TracChangeset for help on using the changeset viewer.