Repository navigation
Editor: Add the rotation block support - #14707
Draft
draganescu wants to merge 3 commits into
Draft
draganescu wants to merge 3 commits into
draganescu wants to merge 3 commits 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
Renames the support to `rotation` and makes it opt-in with `supports.rotation: true`, matching Gutenberg, where the support is no longer behind an experiment. Renames the file to `block-supports/rotation.php`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 rotation block support from Gutenberg (#84505). The support is no longer behind an experiment there, and blocks opt in to it. This stays a draft until the Gutenberg PR is ready.
src/wp-includes/block-supports/rotation.php: block types support rotation when they opt in withsupports.rotation: true, 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/rotation-test.php.The
supports.rotation: trueopt-ins for the Image, Video, Heading and Group blocks are in theirblock.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