-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A11y: Move script module HTML printing to 6.7 compat #65620
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This code is needed for compatibility with WordPress < 6.7. The filter should only be registered if the Core filter will not run, otherwise redundant elements are printed. See: WordPress/wordpress-develop#7405
8de717e
to
e4b36b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with:
- Core trunk (including the changes from Add @wordpress/a11y script module wordpress-develop#7405)
- Core trunk version without Add @wordpress/a11y script module wordpress-develop#7405
Works like a charm in both cases 👍
- Ensure that the HTML printing for the @wordpress/a11y script module does not conflict with Core. - Move the @wordpress/a11y script module code to the 6.7 compat directory. The a11y script module HTML printing filters are set conditionally. If Core would set them, Gutenberg does not. This ensures that duplicate HTML elements (with identical element IDs) are not added to the page. This is necessary for compatibility with WordPress 6.7 that adds the @wordpress/a11y Script Module. See https://core.trac.wordpress.org/changeset/59089. --- Co-authored-by: sirreal <jonsurrell@git.wordpress.org> Co-authored-by: michalczaplinski <czapla@git.wordpress.org>
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 783c65e |
What?
@wordpress/a11y
script module does not conflict with Core.@wordpress/a11y
script module code to the 6.7 compat directory.This PR is dependent on WordPress/wordpress-develop#7405
Why?
When WordPress/wordpress-develop#7405 lands, this could would run redundantly and create multiple DOM elements with the same ID.
How?
Conditionally set the filters based on the presence of the new method in Core.
Testing Instructions
Ensure the regions are created but are not duplicated when testing with Core ([59089] or later).