Skip to content

Allow InnerBlocks Component's allowedBlocks prop to pass options to child blocks #63997

Closed as duplicate

Description

@acketon

What problem does this address?

InnerBlocks Component gives us a lot of power and the existing options for templates and locking for instance are great. However I recently ran into a use case where I have a parent block using an InnerBlocks component and wanted to use the core/paragraph block as a child block. However the block's default allowedFormats from the Formats API allows for things like Inline Images that due to design limitations of this particular block don't make sense to allow due to space.

I could create my own custom Paragraph block but that doesn't seem great when the core Paragraph block is perfect if I could disable certain formats. I can do that via a filter on the block but if I want to allow Inline Images elsewhere then it gets more complicated and I suppose I'd have to have my filter of the core/paragraph block try to determine if this instance of the block is a child of my custom parent block.

What is your proposed solution?

Could we make it easier to modify allowedFormats option of RichText in nested child blocks for instance?

Could the allowedBlocks prop on InnerBlocks be expanded to allow for more than just an array of strings with the block names? Could you pass an object instead that specifies the allowed block and some options to be passed to the block in just that instance when it is nested in that InnerBlocks context?

Activity

  1. added
    [Feature] Nested / Inner BlocksAnything related to the experience of nested/inner blocks inside a larger container, like Group or P
    on Jul 27, 2024
  2. Mamaduka commented on Mar 28, 2025

    @Mamaduka
    Member

    Thanks for contributing, @acketon!

    I believe this issue is more about controlling block formats and allowing customizing allowedFormats for block types. If the allowedFormats format could be modified using block attributes, you could easily configure it for inner blocks.

    There's already a similar proposal - #43084. I'm going to close this as a duplicate. Please subscribe to that issue for future updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Nested / Inner BlocksAnything related to the experience of nested/inner blocks inside a larger container, like Group or P[Package] Format library/packages/format-library[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions