Repository navigation
Editor: Add the rotate block support - #14707
Draft
draganescu wants to merge 1 commit into
Draft
draganescu wants to merge 1 commit into
draganescu wants to merge 1 commit into
Conversation
Backports the rotate block support from Gutenberg: block types support rotation unless they opt out with `supports.rotate: false`. The angle is stored in `style.rotate`, with viewport overrides in `style['@tablet'].rotate` and `style['@mobile'].rotate`, and rendered with the CSS `rotate` property under a generated class in the block supports stylesheet. Adds `rotate` to the safe CSS properties so the style engine keeps the declaration. Synced from WordPress/gutenberg#84505. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 3 tasks
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. |
This was referenced Oct 22, 2026
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 the rotate block support from Gutenberg (#84505), where it is still behind the "Block rotation" experiment. Opened as a draft so the Gutenberg PR has its backport changelog entry; it isn't ready to commit until the support leaves the experiment.
src/wp-includes/block-supports/rotate.php: block types support rotation unless they opt out withsupports.rotate: false, and get astyleattribute for it. The angle is stored instyle.rotate, with viewport overrides instyle['@tablet'].rotateandstyle['@mobile'].rotate, where 0 undoes the default rotation. Stored values are treated as untrusted: only numbers and decimal numeric strings are read, rounded to two decimals and wrapped into (-180, 180].wp_render_rotate_support()adds the rules to the block supports stylesheet under a class generated from them, using the CSSrotateproperty so it combines with anytransform, with viewport overrides in the theme's viewport media queries. Saved markup doesn't change.src/wp-includes/kses.php: addsrotateto the safe CSS properties, since the style engine filters every declaration throughsafecss_filter_attr().phpunit/block-supports/rotate-test.php. They pass against 7.2-alpha with the ported file loaded.The
supports.rotate: falseopt-outs for blocks without a wrapper of their own (Classic, Custom HTML, Missing, More, Page Break, Pattern, Shortcode and synced patterns) are in the blocks'block.jsonfiles, which arrive with the package update.Trac ticket:
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the Gutenberg block support and its tests to Core naming, and writing this description. The support itself was written in Gutenberg with the same tool and reviewed 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.
🤖 Generated with Claude Code