Created
March 19, 2019 22:48
-
-
Save jorgefilipecosta/b50b090932b22bff1abe193fd0f5d649 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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