Skip to content

Navigation block: allow extending the list of allowed inner blocks #31387

@Aljullu

Description

@Aljullu

The Navigation block has a hard-coded list of allowed inner blocks:

const ALLOWED_BLOCKS = [
'core/navigation-link',
'core/search',
'core/social-links',
'core/page-list',
'core/spacer',
];

But plugins might want to add more blocks to that list. For example, WooCommerce could add a Product Search block or a minicart block (ie: a link to the Cart which shows the number of products in the cart).

If I'm not wrong, there is no way plugins can do that right now, so this issue is about making the ALLOWED_BLOCKS list filterable or introducing some other API so plugins can extend the list of allowed blocks inside the Navigation block.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions