WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/09/2019 08:57:06 PM (14 months 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/includes/ms.php

    r45084 r45300  
    11191119        $classes = array( 'nav-tab' );
    11201120
     1121        // Aria-current attribute.
     1122        $aria_current = '';
     1123
    11211124        // Selected is set by the parent OR assumed by the $pagenow global
    11221125        if ( $r['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
    1123             $classes[] = 'nav-tab-active';
     1126            $classes[]    = 'nav-tab-active';
     1127            $aria_current = ' aria-current="page"';
    11241128        }
    11251129
     
    11311135
    11321136        // Add link to nav links
    1133         $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '">' . esc_html( $link['label'] ) . '</a>';
     1137        $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';
    11341138    }
    11351139
Note: See TracChangeset for help on using the changeset viewer.