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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.