Browse Source

Add aria-label to primary nav (#282)

* Add aria-label to primary nav
pull/288/head
Steel Wagstaff 3 years ago committed by GitHub
parent
commit
3667d97687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      header.php
  2. 2
      inc/helpers/namespace.php

1
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',
]

2
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']}'><ul id='{$args['menu_id']}' class='{$args['menu_class']}'>%s</ul></{$args['container']}>",
"<{$args['container']} id='{$args['container_id']}' class='{$args['container_class']}' aria-label='{$args['container_aria_label']}'><ul id='{$args['menu_id']}' class='{$args['menu_class']}'>%s</ul></{$args['container']}>",
get_default_menu( $items )
);
if ( class_exists( '\PressbooksOAuth\OAuth' ) ) {

Loading…
Cancel
Save