Skip to content

Commit

Permalink
Tweak: Add aria-label attribute to various <nav> elements (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
rami-elementor authored May 26, 2024
1 parent e71e824 commit ccc827f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion template-parts/dynamic-footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</div>

<?php if ( $footer_nav_menu ) : ?>
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_footer_menu_display' ) ); ?>">
<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' ); ?>">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $footer_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand Down
4 changes: 2 additions & 2 deletions template-parts/dynamic-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>

<?php if ( $header_nav_menu ) : ?>
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>">
<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' ); ?>">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $header_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand All @@ -65,7 +65,7 @@
<span class="screen-reader-text"><?php echo esc_html__( 'Menu', 'hello-elementor' ); ?></span>
</button>
</div>
<nav class="site-navigation-dropdown <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>" aria-hidden="true" inert>
<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>
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $header_mobile_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand Down
2 changes: 1 addition & 1 deletion template-parts/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
?>
<footer id="site-footer" class="site-footer">
<?php if ( $footer_nav_menu ) : ?>
<nav class="site-navigation">
<nav class="site-navigation" aria-label="<?php echo esc_attr__( 'Footer menu', 'hello-elementor' ); ?>">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $footer_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand Down
2 changes: 1 addition & 1 deletion template-parts/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>

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

0 comments on commit ccc827f

Please sign in to comment.