Opened 7 weeks ago
Closed 3 weeks ago
#62895 closed defect (bug) (fixed)
Bundled Themes: Accessibility additions to the site title link
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch commit |
Focuses: | accessibility | Cc: |
Description (last modified by )
In most bundled themes, the aria-current and rel="home" attributes are missing on the site logo.
Can be seen at: https://wp-themes.com/twentytwenty/
Change History (10)
This ticket was mentioned in PR #8237 on WordPress/wordpress-develop by @bschneidewind.
7 weeks ago
#1
- Keywords has-patch added
#2
@
7 weeks ago
Test Report:
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/8237
I have tested the above PR, and the header logo includes the rel="home" and aria-current="page" attributes.
Environment:
OS: macOS 15.2 (24C101)
Browser: Microsoft Edge Version 132.0.2957.127 (Official build) (arm64)
Screenshot: https://share.cleanshot.com/yyspBNJP95d7p2J5vHwS
#3
@
7 weeks ago
- Keywords changes-requested added
I think you mean the site title (text) link; the site logo gets its link from get_custom_logo()
.
The PR replaces the title
argument with two new arguments. The title
argument should remain usable, but you could add rel="home"
to the default:
'title' => '<a href="%1$s" rel="home">%2$s</a>',
Then you could add the aria-current
attribute
- if it matches the conditions in
get_custom_logo()
(see #62879 for any updates) and - if the
title
argument matches the default value.$contents = sprintf( $args['title'], esc_url( get_home_url( null, '/' ) ), esc_html( $site_title ) ); if ( ( is_front_page() || is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) && ! is_paged() && $args['title'] === $defaults['title'] ) { $contents = str_replace( ' rel=', ' aria-current="page" rel=', $contents ); } $classname = $args['title_class'];
I purposely did not use the condition
argument because it can be customized, and even its default value does not include ! is_paged()
. The condition
determines whether the wrapping element is a heading, but aria-current
would be more exclusive.
#4
@
7 weeks ago
- Keywords changes-requested removed
- Summary changed from Twenty Twenty: site logo link missing aria-current and rel=home to Twenty Twenty: site title link missing aria-current and rel=home attributes
Thank you @sabernhardt ~ just took care of those updates!
#5
@
7 weeks ago
- Summary changed from Twenty Twenty: site title link missing aria-current and rel=home attributes to Bundled Themes: Accessibility additions to the site title link
Updated the scope to include all bundled themes:
TwentyTen
TwentyEleven
TwentyTwelve
TwentyThirteen
TwentyFourteen
TwentyFifteen
TwentySixteen
TwentySeventeen
TwentyNineteen
TwentyTwenty
TwentyTwentyOne
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
6 weeks ago
#7
@
6 weeks ago
- Description modified (diff)
- Milestone changed from Awaiting Review to 6.8
- Owner set to joedolson
- Status changed from new to accepted
#8
@
3 weeks ago
- Keywords commit added
I've reviewed the PR and added support for the rel
and aria-current
attributes on linked header images where appropriate, and made a couple minor fixes. Marking for commit.
In Twenty Twenty theme, adds the aria-current="page" (when applicable) and rel="home" to the site logo.
Trac ticket: https://core.trac.wordpress.org/ticket/62895