You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ability to restrict the list of allowed inner blocks to core blocks #35966
When working with custom blocks there are examples of blocks like for example a custom image carousel that should never be allowed within a core cover block. Or a custom grid block that should not be inserted in a column block. This currently is not possible.
What is your proposed solution?
Either adding a filter in the core blocks that allows you to use the wp.hooks.addFilter function to modify the list of allowedBlocks passed to the inner blocks component within the core blocks.
There also is an old proposal here: #16560 that feels very similar that would add the allowed inner blocks to the blocks attributes / supports.
Yes. But what about adding restricting blocks on core/quote author field? You can add anything there. const quote_metadata in block-library.js does not have allowedBlocks field, hence I can not even use addFilter hook.
Activity
fabiankaegy commentedon Nov 5, 2021
This appears to be resolved for the Core Column block as of #35342 and the Core Cover block as of #31326
madfcat commentedon Jul 30, 2023
Yes. But what about adding restricting blocks on
core/quoteauthor field? You can add anything there.const quote_metadatainblock-library.jsdoes not haveallowedBlocksfield, hence I can not even useaddFilterhook.fabiankaegy commentedon Jul 31, 2023
@madfcat I'd encourage you to open a specific issue for that block