[wp-trac] [WordPress Trac] #59502: Tabindex greater than zero -WordPress core issue-
WordPress Trac
noreply at wordpress.org
Fri Sep 29 14:11:55 UTC 2023
#59502: Tabindex greater than zero -WordPress core issue-
---------------------------+----------------------
Reporter: candelatironi | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Toolbar | Version:
Severity: normal | Resolution: invalid
Keywords: | Focuses:
---------------------------+----------------------
Changes (by joedolson):
* keywords: Tabindex wp-toolbar WordPress core =>
* resolution: => invalid
* status: new => closed
* component: Users => Toolbar
* milestone: Awaiting Review =>
Comment:
This problem has already been fixed, to the best degree possible in
WordPress core.
When the admin toolbar is active, it appears at the top of the screen, and
needs to receive focus before the rest of the page. To do this, the first
element in the toolbar is given a tabindex of 1 if the code is rendered in
the footer - which is where it was rendered for a long time.
When WordPress core added the `wp_body_open()` theme function in version
5.2.0, the rendering of the admin bar was moved to the top of the page if
that function was present in the theme, and tabindex is no longer assigned
in that case.
So this is actually a problem in your theme, which needs to add the
`wp_body_open()` function right after the opening `body` element.
Here's the dev note announcing the new hook:
https://make.wordpress.org/themes/2019/03/29/addition-of-new-wp_body_open-
hook/
See #50702.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59502#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list