-
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
Extract block variations API into its own handbook page #29515
Conversation
We could link to the new one from "key concepts" which has a section on block variations. |
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
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.
Thanks for expanding the block variations explanation as well as adding the embed examples! 💯
I linked to the new page from the FAQ block variations section as well.
|
||
Block variations can be declared during a block's registration by providing the `variations` key with a proper array of variations, as defined above. In addition, there are ways to register and unregister a `block variation` for a block, after its registration. | ||
|
||
To add a block variation use `wp.blocks.registerBlockVariation()`. |
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.
We probably should discuss separately whether stop referencing APIs through wp
globals and promote consistently ES modules.
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 added one minor comment with a minor note with a proposal for clarification.
Excellent work, thank you for taking care of it and extending the existing documentation in such an elegant way 👍🏻
docs/designers-developers/developers/block-api/block-variations.md
Outdated
Show resolved
Hide resolved
Add a link to the new block variations documentation page from the FAQ.
…s.md Co-authored-by: Greg Ziółkowski <[email protected]>
ff69ae0
to
732446a
Compare
Thanks so much @ntsekouras! Don't need to backport this since the handbook is generated from the |
Description
Resolves: #25451
This PR extracts and extends the existing Block Variation API docs into a sub-section of "Block API Reference".
You can see the new page here.