Last active
December 15, 2017 23:06
-
-
Save bradpotter/a2cb88757c7e95080ce2d9ef4029fb7c to your computer and use it in GitHub Desktop.
Modify post type for Gutenberg
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 modify_post_type() { | |
//new args | |
$args = array( | |
'public' => true, | |
'label' => 'Posts', | |
'show_in_rest' => true, | |
'template' => array( | |
array( 'core/cover-image' ), | |
array( 'core/image' ), | |
array( 'core/quote' ), | |
array( 'core/heading' ), | |
array( 'core/embed' ), | |
array( 'core/paragraph' ), | |
array( 'core/paragraph' ), | |
array( 'core/paragraph' ), | |
), | |
); | |
//re-register the post type to include new args | |
register_post_type( 'post', $args ); | |
} | |
add_action( 'init', 'modify_post_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also do: