Skip to content

Toolbar: Add a "Skip toolbar" link when the toolbar precedes the page content - #14410

Closed
R1shabh-Gupta wants to merge 4 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/66331-add-skip-toolbar-link
Closed

R1shabh-Gupta wants to merge 4 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/66331-add-skip-toolbar-link

Conversation

@R1shabh-Gupta

Copy link
Copy Markdown

When the toolbar is rendered on wp_body_open, it is the first thing on the page, so keyboard users must tab through every toolbar item before reaching the content.

This adds a "Skip toolbar" link as the first element of the toolbar, targeting an empty, focusable element (tabindex="-1") appended after the toolbar items.

  • Only output on the front end, when the toolbar precedes the content.
  • No change for themes without wp_body_open support, which keep the existing "Skip to toolbar" link.

Trac ticket: https://core.trac.wordpress.org/ticket/66331

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Code Review & Writing test cases


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@R1shabh-Gupta
R1shabh-Gupta marked this pull request as ready for review October 19, 2026 09:38
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props rishabhwp, joedolson.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@joedolson joedolson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change; but this is otherwise in good shape.

Comment thread src/wp-includes/class-wp-admin-bar.php Resolved
@R1shabh-Gupta
R1shabh-Gupta force-pushed the fix/66331-add-skip-toolbar-link branch from 0959d7f to d30c530 Compare October 29, 2026 07:35
@R1shabh-Gupta
R1shabh-Gupta force-pushed the fix/66331-add-skip-toolbar-link branch from 87e774a to dce6b04 Compare November 2, 2026 11:40
@joedolson
joedolson dismissed their stale review November 6, 2026 22:41

Resolved

@joedolson joedolson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I debated for quite a while over having a name for the target, but ultimately feel that omitting it is better.

wporg-sync pushed a commit that referenced this pull request Nov 6, 2026
When the admin bar is rendered in the footer, a link is added to skip to the toolbar. However, if it is rendered at `wp_body_open`, it injects significant repeated content at the beginning of the page with no bypass mechanism.

Add a skip link that targets a point after the end of the admin bar when it is rendered during `wp_body_open`, allowing users to bypass the navigation, supporting WCAG 2.4.1: Bypass Blocks.

Developed in #14410.

Props travisjeans, rishabhwp, ravi patel, joedolson.
Fixes #66331.

git-svn-id: https://develop.svn.wordpress.org/trunk@65325 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65325
GitHub commit: d2fc75d

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 6, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 6, 2026
When the admin bar is rendered in the footer, a link is added to skip to the toolbar. However, if it is rendered at `wp_body_open`, it injects significant repeated content at the beginning of the page with no bypass mechanism.

Add a skip link that targets a point after the end of the admin bar when it is rendered during `wp_body_open`, allowing users to bypass the navigation, supporting WCAG 2.4.1: Bypass Blocks.

Developed in WordPress/wordpress-develop#14410.

Props travisjeans, rishabhwp, ravi patel, joedolson.
Fixes #66331.
Built from https://develop.svn.wordpress.org/trunk@65325


git-svn-id: http://core.svn.wordpress.org/trunk@64465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants