Conversation
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
t-hamano
force-pushed
the
66112-icons-rect-circle-sanitizer
branch
2 times, most recently
from
September 15, 2026 14:05
44ca689 to
14edf58
Compare
A number of icons in the icon library are redrawn with the `rect` and `circle` elements. `WP_Icons_Registry::sanitize_icon_content()` allows the `svg`, `path` and `polygon` tags only, so `wp_kses()` removes both elements before the icon is stored or returned. This adds `rect` and `circle` to the allowlist, carrying the same presentation attributes the existing shapes have along with the geometry attributes each element needs. Props wildworks, retrofox. See #66101. Fixes #66112. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
t-hamano
force-pushed
the
66112-icons-rect-circle-sanitizer
branch
from
September 15, 2026 14:10
14edf58 to
e3e6d1e
Compare
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.
Backports Gutenberg PR #82846 to the Core icon registry.
A number of icons in the icon library are redrawn with the
rectandcircleelements, butWP_Icons_Registry::sanitize_icon_content()allows thesvg,pathandpolygontags only, sowp_kses()removes both elements before the icon is stored or returned. Icons registered by plugins and themes throughwp_register_icon()are affected today, and the redrawn library icons will lose part of their shape once they are synced to Core.Both new entries carry the presentation attributes the existing shapes already have, plus the geometry attributes each element needs.
Notes:
rectandcircleneed to carry them as well, since the two elements are drawn with strokes in the library today.focusableis not included. It is meaningful on thesvgroot element only, and the entry onpolygonis a leftover from the Twenty Twenty allowlist this list was copied from.Trac ticket: https://core.trac.wordpress.org/ticket/66112
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Porting the Gutenberg change to its Core equivalent and drafting the unit tests. The result was reviewed and edited by me.
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.