return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>custom post types - Creating template with h3 block (block editor)
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Creating template with h3 block (block editor)

programmeradmin1浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 3

Just 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'
      )
    )
  )
));
发布评论

评论列表(0)

  1. 暂无评论