Skip to content

Commit ccc827f

Browse files
Tweak: Add aria-label attribute to various <nav> elements (#405)
1 parent e71e824 commit ccc827f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

template-parts/dynamic-footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</div>
4646

4747
<?php if ( $footer_nav_menu ) : ?>
48-
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_footer_menu_display' ) ); ?>">
48+
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_footer_menu_display' ) ); ?>" aria-label="<?php echo esc_attr__( 'Footer menu', 'hello-elementor' ); ?>">
4949
<?php
5050
// PHPCS - escaped by WordPress with "wp_nav_menu"
5151
echo $footer_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

template-parts/dynamic-header.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</div>
5252

5353
<?php if ( $header_nav_menu ) : ?>
54-
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>">
54+
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>" aria-label="<?php echo esc_attr__( 'Main menu', 'hello-elementor' ); ?>">
5555
<?php
5656
// PHPCS - escaped by WordPress with "wp_nav_menu"
5757
echo $header_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
@@ -65,7 +65,7 @@
6565
<span class="screen-reader-text"><?php echo esc_html__( 'Menu', 'hello-elementor' ); ?></span>
6666
</button>
6767
</div>
68-
<nav class="site-navigation-dropdown <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>" aria-hidden="true" inert>
68+
<nav class="site-navigation-dropdown <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>" aria-label="<?php echo esc_attr__( 'Mobile menu', 'hello-elementor' ); ?>" aria-hidden="true" inert>
6969
<?php
7070
// PHPCS - escaped by WordPress with "wp_nav_menu"
7171
echo $header_mobile_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

template-parts/footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
?>
1919
<footer id="site-footer" class="site-footer">
2020
<?php if ( $footer_nav_menu ) : ?>
21-
<nav class="site-navigation">
21+
<nav class="site-navigation" aria-label="<?php echo esc_attr__( 'Footer menu', 'hello-elementor' ); ?>">
2222
<?php
2323
// PHPCS - escaped by WordPress with "wp_nav_menu"
2424
echo $footer_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

template-parts/header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</div>
4141

4242
<?php if ( $header_nav_menu ) : ?>
43-
<nav class="site-navigation">
43+
<nav class="site-navigation" aria-label="<?php echo esc_attr__( 'Main menu', 'hello-elementor' ); ?>">
4444
<?php
4545
// PHPCS - escaped by WordPress with "wp_nav_menu"
4646
echo $header_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

0 commit comments

Comments
 (0)