-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Block Library - Post Terms]: Add transforms for variations #48328
Conversation
Size Change: 0 B Total Size: 1.33 MB ℹ️ View Unchanged
|
Flaky tests detected in 8a15936. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4244861552
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, and very cool that it only involved changing a couple of lines of code 👍
This is testing well — with no plugins other than Gutenberg installed, the icons approach is used as the Tags and Categories have unique icons. With a plugin like WooCommerce installed, that doesn't have unique icons for each of the variations / taxonomies, the dropdown list is used:
Only GB installed | WooCommerce installed |
---|---|
![]() |
![]() |
Switching between the variations is working nicely, too. LGTM! ✨
What?
Post Terms variations are created dynamically based on the registered public(and with REST support) taxonomies. This PR enables these variations to be easily switched through the transform variations UI in block inspector controls.
Testing Instructions
post terms
block variation - a basic example would be to insertCategories
variation through the inserter.Notes
The transform variation UI shows icons if all variation have an icon and all icons are unique. If this is not true, it renders a dropdown list.
Unique icons
Screen.Recording.2023-02-22.at.6.22.12.PM.mov
Dropdown
Screen.Recording.2023-02-22.at.6.18.08.PM.mov