-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
The heading level dropdown in the Heading block is powered by the HeadingLevelDropdown component. This component accepts and options
parameter that allows you to choose which levels are available in the dropdown. Unfortunately, there is no way to modify this options
parameter from a Heading block.
Being able to modify the available levels is critical for heavily curated editing environments and block "governance".
Consider the following situations:
- You only want to allow
h2
,h3
, andh4
in Media & Text blocks. - You want to disable
h1
on posts since the template already populates anh1
for the post title. - You want to disable the usage of
h5
andh6
across the whole site. - etc.
Curating the available heading levels is currently not possible, but it should be easy to implement using an additional attribute for the Heading block. Developers can then modify this attribute as they need, either directly in theme patterns and templates or via block filters like blocks.registerBlockType
or register_block_type_args
.
Current functionality | Goal |
---|---|
Should the mechanism be added to Heading blocks, we should explore similar mechanisms for other blocks with level dropdowns, like Site Title, Post Title, etc.