Add a mechanism to Heading blocks that allows you to control the available levels #63527
Labels
[Block] Heading
Affects the Headings Block
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Status] Duplicate
Used to indicate that a current issue matches an existing one and can be closed
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
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 thisoptions
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:
h2
,h3
, andh4
in Media & Text blocks.h1
on posts since the template already populates anh1
for the post title.h5
andh6
across the whole site.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
orregister_block_type_args
.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.
The text was updated successfully, but these errors were encountered: