Skip to content

Commit 8b04def

Browse files
committed
[#47051] Screen reader fix.
1 parent 0a5259d commit 8b04def

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/wp-content/themes/twentynineteen/inc/icon-functions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args )
8080
// Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item.
8181
// @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely.
8282
$link = sprintf(
83-
'<button class="menu-item-link-return" tabindex="-1">%s',
83+
'<button class="menu-item-link-return" tabindex="-1" aria-label="%s">%s',
84+
esc_attr( sprintf( __( 'Return to %s', 'twentynineteen' ), $item->title ) ),
8485
twentynineteen_get_icon_svg( 'chevron_left', 24 )
8586
);
8687

@@ -106,7 +107,8 @@ function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args )
106107
$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );
107108

108109
$item_output .= sprintf(
109-
'<button class="submenu-expand" tabindex="-1">%s</button>',
110+
'<button class="submenu-expand" tabindex="-1" aria-label="%s">%s</button>',
111+
esc_attr( sprintf( __( 'Expand child menu for %s', 'twentynineteen' ), $item->title ) ),
110112
$icon
111113
);
112114
}

0 commit comments

Comments
 (0)