diff --git a/packages/block-library/src/navigation-submenu/index.php b/packages/block-library/src/navigation-submenu/index.php index c0fdbfa271cfa4..60485079897cae 100644 --- a/packages/block-library/src/navigation-submenu/index.php +++ b/packages/block-library/src/navigation-submenu/index.php @@ -188,6 +188,12 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { ); } + $aria_label = sprintf( + /* translators: Accessibility text. %s: Parent page title. */ + __( '%s submenu' ), + $label + ); + $html = '
  • '; // If Submenus open on hover, we render an anchor tag with attributes. @@ -226,11 +232,11 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { if ( $show_submenu_indicators ) { // The submenu icon is rendered in a button here // so that there's a clickable elment to open the submenu. - $html .= ''; + $html .= ''; } } else { // If menus open on click, we render the parent as a button. - $html .= ''; } else { $markup .= '' . $title . ''; @@ -186,7 +191,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click, if ( isset( $page['children'] ) ) { if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) { - $markup .= ''; }