WordPress.org

Make WordPress Core

Ticket #49211: 49211.diff

File 49211.diff, 4.4 KB (added by audrasjb, 20 months ago)

Menus: make tabs panels more accessible for keyboard users

  • src/wp-admin/includes/nav-menu.php

    diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php
    index 9b321ff4f3..726f5f0758 100644
    a b function wp_nav_menu_item_post_type_meta_box( $object, $box ) { 
    517517                        </li>
    518518                </ul><!-- .posttype-tabs -->
    519519
    520                 <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>">
     520                <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" role="region" aria-label="<?php _e( 'Most recent' ); ?>" tabindex="0">
    521521                        <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
    522522                                <?php
    523523                                $recent_args    = array_merge(
    function wp_nav_menu_item_post_type_meta_box( $object, $box ) { 
    552552                        </ul>
    553553                </div><!-- /.tabs-panel -->
    554554
    555                 <div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
     555                <div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search" role="region" aria-label="<?php _e( 'Search results' ); ?>" tabindex="0">
    556556                        <?php
    557557                        if ( isset( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
    558558                                $searched       = esc_attr( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] );
    function wp_nav_menu_item_post_type_meta_box( $object, $box ) { 
    590590                        </ul>
    591591                </div><!-- /.tabs-panel -->
    592592
    593                 <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>">
     593                <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" role="region" aria-label="<?php _e( 'All items' ); ?>" tabindex="0">
    594594                        <?php if ( ! empty( $page_links ) ) : ?>
    595595                                <div class="add-menu-item-pagelinks">
    596596                                        <?php echo $page_links; ?>
    function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) { 
    803803                        </li>
    804804                </ul><!-- .taxonomy-tabs -->
    805805
    806                 <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?> ">
     806                <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" role="region" aria-label="<?php _e( 'Most used' ); ?>" tabindex="0">
    807807                        <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
    808808                                <?php
    809809                                $popular_terms  = get_terms(
    function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) { 
    821821                        </ul>
    822822                </div><!-- /.tabs-panel -->
    823823
    824                 <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?> ">
     824                <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" role="region" aria-label="<?php _e( 'All items' ); ?>" tabindex="0">
    825825                        <?php if ( ! empty( $page_links ) ) : ?>
    826826                                <div class="add-menu-item-pagelinks">
    827827                                        <?php echo $page_links; ?>
    function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) { 
    840840                        <?php endif; ?>
    841841                </div><!-- /.tabs-panel -->
    842842
    843                 <div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
     843                <div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>" role="region" aria-label="<?php _e( 'Search results' ); ?>" tabindex="0">
    844844                        <?php
    845845                        if ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
    846846                                $searched       = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );