I'm trying to register a custom post type with a template containing a preformated h2
and h3
. When I add a core/heading
block, it automatically create a H2
. What parameter should I add in order to have a H3
?
My code looks like this:
register_post_type('custom-post', array(
// [...]
'template' => array(
array(
'core/heading',
array(
'placeholder' => 'this is a H2'
)
),
array(
'core/heading',
array(
'heading' => '3', // this does not work
'placeholder' => 'this should be a H3'
)
)
)
));
I'm trying to register a custom post type with a template containing a preformated h2
and h3
. When I add a core/heading
block, it automatically create a H2
. What parameter should I add in order to have a H3
?
My code looks like this:
register_post_type('custom-post', array(
// [...]
'template' => array(
array(
'core/heading',
array(
'placeholder' => 'this is a H2'
)
),
array(
'core/heading',
array(
'heading' => '3', // this does not work
'placeholder' => 'this should be a H3'
)
)
)
));
Share
Improve this question
asked Dec 18, 2020 at 7:38
maxime schoenimaxime schoeni
2901 silver badge10 bronze badges
1 Answer
Reset to default 3Just figured out the solution: use 'level' => 3
as parameter.
register_post_type('custom-post', array(
// [...]
'template' => array(
array(
'core/heading',
array(
'level' => 3
'placeholder' => 'this is a H3'
)
)
)
));