Display default title is H2, but I don't have this option, only H3 in the dropdown menu
How do I change the default value of the title, e.g. to H3?
When selecting the headings H1 through H6, I removed the headings from the Gutenberg editor and kept only H3.
When I create a new title, the default H2 always appears. i wish I could change it to the default title H3.
function define_editor_heading_levels( $args, $block_type ) {
if ( 'core/heading' !== $block_type ) {
return $args;
}
// Remove H1, H2, H4, H5 and H6
$args['attributes']['levelOptions']['default'] = [ 3 ];
return $args;
}
add_filter( 'register_block_type_args', 'define_editor_heading_levels', 10, 2 );
- newest
- hottest
See only the author.