Make WordPress Core


Ignore:
Timestamp:
03/03/2025 06:43:08 PM (9 months ago)
Author:
joedolson
Message:

Bundled Themes: Add aria-current="page" on header links.

Mark links that point to the current URL in bundled theme headers with aria-current="page" to inform screen reader users that this link is the current page.

Changes to Twenty Ten through Twenty Twenty add aria-current and rel="home" where appropriate, Twenty Twenty One only adds rel="home".

Props bschneidewind, joedolson, hiabhaykulkarni, sabernhardt.
Fixes #62895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/template-parts/header/site-branding.php

    r50802 r59907  
    2929            <h1 class="<?php echo esc_attr( $header_class ); ?>"><?php echo esc_html( $blog_info ); ?></h1>
    3030        <?php elseif ( is_front_page() && ! is_home() ) : ?>
    31             <h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></h1>
     31            <h1 class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_html( $blog_info ); ?></a></h1>
    3232        <?php else : ?>
    33             <p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo esc_html( $blog_info ); ?></a></p>
     33            <p class="<?php echo esc_attr( $header_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_html( $blog_info ); ?></a></p>
    3434        <?php endif; ?>
    3535    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.