WordPress.org

Make WordPress Core

Changeset 47209


Ignore:
Timestamp:
02/07/2020 09:36:59 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Accessibility: Menus: Make tab panels in Add menu items section more accessible for keyboard users.

Props audrasjb, afercia.
Fixes #49211.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/edit.css

    r47147 r47209  
    996996div.tabs-panel-inactive {
    997997    display: none;
     998}
     999
     1000div.tabs-panel-active:focus {
     1001    box-shadow: inset 0 0 0 1px #5b9dd9, inset 0 0 2px 1px rgba(30, 140, 190, 0.8);
     1002    outline: 0 none;
    9981003}
    9991004
  • trunk/src/wp-admin/includes/nav-menu.php

    r47198 r47209  
    336336
    337337    $post_type_name = $box['args']->name;
     338    $post_type      = get_post_type_object( $post_type_name );
    338339
    339340    // Paginate browsing for large numbers of post objects.
     
    518519        </ul><!-- .posttype-tabs -->
    519520
    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' ); ?>">
     521        <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">
    521522            <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
    522523                <?php
     
    553554        </div><!-- /.tabs-panel -->
    554555
    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">
     556        <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 echo $post_type->labels->search_items; ?>" tabindex="0">
    556557            <?php
    557558            if ( isset( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
     
    591592        </div><!-- /.tabs-panel -->
    592593
    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' ); ?>">
     594        <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 echo $post_type->labels->all_items; ?>" tabindex="0">
    594595            <?php if ( ! empty( $page_links ) ) : ?>
    595596                <div class="add-menu-item-pagelinks">
     
    600601                <?php
    601602                $args['walker'] = $walker;
    602 
    603                 $post_type = get_post_type_object( $post_type_name );
    604603
    605604                if ( $post_type->has_archive ) {
     
    687686function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
    688687    global $nav_menu_selected_id;
     688
    689689    $taxonomy_name = $box['args']->name;
    690690    $taxonomy      = get_taxonomy( $taxonomy_name );
     
    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 echo $taxonomy->labels->most_used; ?>" tabindex="0">
    807807            <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
    808808                <?php
     
    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 echo $taxonomy->labels->all_items; ?>" tabindex="0">
    825825            <?php if ( ! empty( $page_links ) ) : ?>
    826826                <div class="add-menu-item-pagelinks">
     
    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 echo $taxonomy->labels->search_items; ?>" tabindex="0">
    844844            <?php
    845845            if ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.