From d2022e062b59dbe195281865dccfbf1166f8e881 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Tue, 2 Jul 2024 16:58:08 -0400 Subject: [PATCH] Global header, Local navigation: Add aria label to the main, search, and local nav blocks (#634) * Global header: Add aria label to the main and search nav blocks Fixes #622 * Local navigation: Add aria label to menu inside block --- mu-plugins/blocks/global-header-footer/header.php | 4 ++-- mu-plugins/blocks/local-navigation-bar/index.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mu-plugins/blocks/global-header-footer/header.php b/mu-plugins/blocks/global-header-footer/header.php index 1f858008f..79e2aa026 100644 --- a/mu-plugins/blocks/global-header-footer/header.php +++ b/mu-plugins/blocks/global-header-footer/header.php @@ -81,7 +81,7 @@ function recursive_menu( $menu_item, $top_level = true ) { - + - + diff --git a/mu-plugins/blocks/local-navigation-bar/index.php b/mu-plugins/blocks/local-navigation-bar/index.php index 7318af8d5..6cd8d1ae7 100644 --- a/mu-plugins/blocks/local-navigation-bar/index.php +++ b/mu-plugins/blocks/local-navigation-bar/index.php @@ -98,6 +98,7 @@ function update_child_block_attributes( $parsed_block, $source_block, $parent_bl 'type' => 'flex', 'orientation' => 'horizontal', ); + $parsed_block['attrs']['ariaLabel'] = _x( 'Section', 'local navigation label', 'wporg' ); // Add an extra navigation block which is always collapsed, so that it // can be swapped out when the section title + nav menu collide.