[wp-trac] [WordPress Trac] #62879: get_custom_logo does not apply the aria-current attribute in all cases

WordPress Trac noreply at wordpress.org
Sat Feb 8 21:25:30 UTC 2025


#62879: get_custom_logo does not apply the aria-current attribute in all cases
---------------------------+----------------------------
 Reporter:  bschneidewind  |       Owner:  audrasjb
     Type:  defect (bug)   |      Status:  reviewing
 Priority:  normal         |   Milestone:  6.8
Component:  General        |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  accessibility
---------------------------+----------------------------

Comment (by sabernhardt):

 > Is that actually considered a valid, supported configuration (to have a
 posts page set but not a page set for the homepage)?  That doesn't really
 seem like it would be useful combination of settings to me.

 The edge case might be fine to allow, but I do not think the special posts
 page should have `aria-current` (or `current-menu-item` classes) on home
 links.

 When I assigned the page of posts without a static home page, the two URLs
 gave me duplicate content. With the Site Title block, I had the same link
 attributes at both URLs, too:
 {{{
 <p class="wp-block-site-title"><a href="http://localhost/wp671"
 target="_self" rel="home" aria-current="page">WP 6.7.1</a></p>
 }}}

 The home links' conditions for current-page ARIA and class names might
 need to check the URL (or `$wp->request`) instead of `is_front_page()`
 and/or `is_home()`. The logo link already adds `aria-current` incorrectly
 on the network signup and activation pages. Comments on #43536 note that
 `wp-signup.php` and `wp-activate.php` return `true` for both
 `is_front_page()` and `is_home()`, and `is_home()` potentially can return
 `true` as a fallback in other edge cases.

 History for `aria-current` on home links:
 - [48749] `get_custom_logo()`
 - GB35880 Site Title block
 - GB51478 Home Link block

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62879#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list