mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 22:24:36 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@45300 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1118,9 +1118,13 @@ function network_edit_site_nav( $args = array() ) {
|
||||
// Link classes
|
||||
$classes = array( 'nav-tab' );
|
||||
|
||||
// Aria-current attribute.
|
||||
$aria_current = '';
|
||||
|
||||
// Selected is set by the parent OR assumed by the $pagenow global
|
||||
if ( $r['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
|
||||
$classes[] = 'nav-tab-active';
|
||||
$classes[] = 'nav-tab-active';
|
||||
$aria_current = ' aria-current="page"';
|
||||
}
|
||||
|
||||
// Escape each class
|
||||
@@ -1130,7 +1134,7 @@ function network_edit_site_nav( $args = array() ) {
|
||||
$url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) );
|
||||
|
||||
// Add link to nav links
|
||||
$screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '">' . esc_html( $link['label'] ) . '</a>';
|
||||
$screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';
|
||||
}
|
||||
|
||||
// All done!
|
||||
|
||||
Reference in New Issue
Block a user