From 3667d97687de9bbefe8a798ef702f5838a67eb44 Mon Sep 17 00:00:00 2001 From: Steel Wagstaff Date: Wed, 3 Nov 2021 11:46:05 -0700 Subject: [PATCH] Add aria-label to primary nav (#282) * Add aria-label to primary nav --- header.php | 1 + inc/helpers/namespace.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/header.php b/header.php index 8cde856..242e02d 100644 --- a/header.php +++ b/header.php @@ -87,6 +87,7 @@ 'container' => 'nav', 'container_class' => 'js-header-nav', 'container_id' => 'navigation', + 'container_aria_label' => 'primary', 'menu_id' => 'nav-primary-menu', 'menu_class' => 'nav--primary', ] diff --git a/inc/helpers/namespace.php b/inc/helpers/namespace.php index 482b53d..855cab5 100644 --- a/inc/helpers/namespace.php +++ b/inc/helpers/namespace.php @@ -273,7 +273,7 @@ function get_default_menu( $items = '' ) { */ function default_menu( $args = [], $items = '' ) { printf( - "<{$args['container']} id='{$args['container_id']}' class='{$args['container_class']}'>", + "<{$args['container']} id='{$args['container_id']}' class='{$args['container_class']}' aria-label='{$args['container_aria_label']}'>", get_default_menu( $items ) ); if ( class_exists( '\PressbooksOAuth\OAuth' ) ) {