-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
General: Add allowed_blocks field to block registration and REST API #5988
Conversation
9e5ecc2
to
1a83218
Compare
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. |
|
Done ✅ |
CI is unhappy about something. Other than that, I have enough to commit it tomorrow. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core SVNIf you're a Core Committer, use this list when committing to
GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Committed with https://core.trac.wordpress.org/changeset/57521. |
There is a new block.json field called
allowedBlocks
, added in Gutenberg in WordPress/gutenberg#58262. This is a companion patch to support this new field also on the server. It ensures that the following works:allowedBlocks
field is defined in block'sblock.json
, the objects registered inWP_Block_Type_Registry
will have theallowed_blocks
field.allowed_blocks
field is returned by the/wp/v2/block-types
REST endpoint.allowedBlocks
field will be included in the boostrapped block registration data in theunstable__bootstrapServerSideBlockDefinitions
inline script.Trac ticket: https://core.trac.wordpress.org/ticket/60403
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.