A11y: Move script module HTML printing to 6.7 compat#65620
Merged
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
michalczaplinski
approved these changes
Sep 25, 2024
Contributor
michalczaplinski
left a comment
There was a problem hiding this comment.
Tested with:
- Core trunk (including the changes from WordPress/wordpress-develop#7405)
- Core trunk version without WordPress/wordpress-develop#7405
Works like a charm in both cases 👍
gutenbergplugin
pushed a commit
that referenced
this pull request
Sep 26, 2024
- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
@wordpress/a11yscript module does not conflict with Core.@wordpress/a11yscript 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).