最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

templates - Lock post meta block at the bottom of a custom post type

programmeradmin1浏览0评论

I'm using the template feature of Gutenberg to add a post meta block (with a couple of input fields) at the bottom of a custom post type:

$args = array(
    'show_ui' => true,
    'show_in_rest' => true,
    'public' => true,
    'labels' => { ...array of labels here... }
    'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' ), 
    'template' => array(
         array( 'my/custom-meta-block' ),
    ),
    'template_lock' => 'all',
);
register_post_type( 'custom-post-type', $args );

I'm using the template_lock parameter to disallow users to remove and add other instances of this block. My question is, can I lock this block but allow other blocks to be added above it in a post? If so, how?

Thanks in advance

发布评论

评论列表(0)

  1. 暂无评论