Skip to content

support multiple namespaces in registerBlockCollection() #69656

@acketon

Description

@acketon

What problem does this address?

It would be nice if a block collection could contain blocks from more than one namespace to better organize and consolidate block categories & collections in the block inserter.

Currently:

registerBlockCollection( 'myname', {
	title: 'My Blocks',
} );

Could we pass an optional array?

registerBlockCollection( ['myname', myname2], {
	title: 'My Blocks',
} );

We have an older block plugin with many blocks in it. However many of the blocks are using inconsistent prefixes in their block names. It was built in 2019 against the beta of the Gutenberg plugin so we didn't have good guidance on this.

Renaming the existing blocks in use on many sites is a challenge but I'd still like to be able to combine them into one collection.

What is your proposed solution?

Support passing an array of namespaces and display blocks from all of those namespaces into that single collection in the inserter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DecisionNeeds a decision to be actionable or relevant[Feature] Block APIAPI that allows to express the block paradigm.[Package] Blocks/packages/blocks[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