Make WordPress Core


Ignore:
Timestamp:
05/09/2019 08:57:06 PM (7 years ago)
Author:
afercia
Message:

Accessibility: Add aria-current to the links in the <nav> elements introduced in [44905].

Also fixes a few translators comments and coding standards.

Props audrasjb.
Fixes #47106.

File:
1 edited

Legend:

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

    r45140 r45300  
    621621
    622622        $nav_tab_active_class = '';
     623        $nav_aria_current     = '';
    623624        if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) {
    624625                $nav_tab_active_class = ' nav-tab-active';
     626                $nav_aria_current     = ' aria-current="page"';
    625627        }
    626628        ?>
     
    629631
    630632        <nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
    631                 <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php echo $nav_tab_active_class; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a>
     633                <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php echo $nav_tab_active_class; ?>"<?php echo $nav_aria_current; ?>><?php esc_html_e( 'Edit Menus' ); ?></a>
    632634                <?php
    633635                if ( $num_locations && $menu_count ) {
    634636                        $active_tab_class = '';
     637                        $aria_current     = '';
    635638                        if ( $locations_screen ) {
    636639                                $active_tab_class = ' nav-tab-active';
     640                                $aria_current     = ' aria-current="page"';
    637641                        }
    638642                        ?>
    639                         <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php echo $active_tab_class; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a>
     643                        <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php echo $active_tab_class; ?>"<?php echo $aria_current; ?>><?php esc_html_e( 'Manage Locations' ); ?></a>
    640644                        <?php
    641645                }
     
    879883                                        }
    880884                                        ?>
    881                                          <input type="hidden" name="action" value="update" />
     885                                        <input type="hidden" name="action" value="update" />
    882886                                        <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
    883887                                        <div id="nav-menu-header">
     
    957961                                                                                                <span class="theme-location-set">
    958962                                                                                                <?php
    959                                                                                                         /* translators: %s: menu name */
    960963                                                                                                        printf(
     964                                                                                                                /* translators: %s: menu name */
    961965                                                                                                                _x( '(Currently set to: %s)', 'menu location' ),
    962966                                                                                                                wp_get_nav_menu_object( $menu_locations[ $location ] )->name
Note: See TracChangeset for help on using the changeset viewer.