Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Created March 19, 2019 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgefilipecosta/b50b090932b22bff1abe193fd0f5d649 to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/b50b090932b22bff1abe193fd0f5d649 to your computer and use it in GitHub Desktop.
function gutenberg_test_cpt_locking() {
$template = array(
array( 'core/image' ),
array(
'core/paragraph',
array(
'placeholder' => 'Add a description',
),
),
array( 'core/quote' ),
);
register_post_type(
'locked-insert-post',
array(
'public' => true,
'label' => 'Locked Insert Post',
'show_in_rest' => true,
'template' => $template,
'template_lock' => 'insert',
)
);
}
add_action( 'init', 'gutenberg_test_cpt_locking' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment