Add option to block API to only allow root level insertion #42548
Labels
Developer Experience
Ideas about improving block and theme developer experience
[Feature] Block API
API that allows to express the block paradigm.
[Feature] Nested / Inner Blocks
Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
[Type] Enhancement
A suggestion for improvement.
[Type] New API
New API to be used by plugin developers or package users.
What problem does this address?
There are instances where a block should only ever exist at the root level of the block editor. It should never be nested within a Group or any other InnerBlocks area. Examples of this are things like the Page Header Template Part. Also when building custom blocks this is something that comes up here and there.
Often this is best paired with the
supports.multiple
option set to false so an editor can only insert the block once at the root levelWhat is your proposed solution?
Add a new Block Supports option that is essentially the opposite of
ancestor
orparent
. Maybe it could even use theparent
key just set to false.The text was updated successfully, but these errors were encountered: