Use a more specific <script>
matching
#23407
Merged
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.
Description
Uses a more specific matching pattern to only affect the
<script>
tags which we're interested in.This should resolve the issues in #23158
This uses the full
<script>
produced byWP_Scripts::do_item()
ignoring the Translations and before/after inline scripts, which allows for it to exclude<script%
tags contained within the before/after html chunks.The major change I see here after testing is two fold:
wp-polyfill
no longer getdata-handle
elements, as they're not built the same way, where they previously were, eg:I'm unsure if this is a concern, as I don't believe scripts should be depending on individual
wp-polyfill-*
scripts and only the main polyfill library?How has this been tested?
As in #23158
data-handle
attributes on appropriate script tags.post-new.php
comparing before/after.Types of changes
Bug Fix.
Checklist: