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
Add block variations to FAQ #29154
Add block variations to FAQ #29154
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @priethor! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Size Change: -57 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
docs/designers-developers/faq.md
Outdated
|
||
No, block variations are different versions of a single base block, sharing a similar functionality, but with slight differences in their implementation, or settings (attributes, InnerBlocks,etc). Block variations are transparent for users, and once registered a block variation, it will appear as a new block. For example, the `embed` block registers different block variations to embed content from specific providers. | ||
|
||
On the other hand, [block styles](/docs/designers-developers/developers/filters/block-filters.md#block-style-variations) allow providing alternative styles to existing blocks, and they work by adding a className to the block’s wrapper. Once a block has registered block styles, block style selector will appear in its sidebar so that users can chose among the different registered styles. |
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.
I might rephrase this to: "Meanwhile, block styles allow you to provide alternative styles to existing blocks"
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.
I agree with you, although I copied that phrasing from the Block Style variations documentation. Do you think it might be worth changing it there, too? 🤔
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.
Yes! Definitely good to update in both places as the current phrasing is pretty strange.
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.
Left some minor suggestions! Thank you for including this :)
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.
Thank you @priethor ! Improvements in documentation are 💯 !!
Congratulations on your first merged pull request, @priethor! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
Description
Seeing there is some confusion regarding block variations and block style variations, I added this topic to the FAQ. I linked to the block styles variations filter but AFAIK there is no equivalent for
registerBlockVariation
, just the @wordpress/blocks package API definition.