Created
August 14, 2012 13:59
-
-
Save asimpson/3349465 to your computer and use it in GitHub Desktop.
Easy way to pull down a Custom Post Type Boilerplate
This file contains hidden or 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
<?php | |
function function_cpt() { | |
$post_type_args = array( | |
'label' => "Label", | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'menu_position' => 5, | |
'query_var' => true, | |
'rewrite' => array( | |
'with_front' => false, | |
'slug' => 'slug' | |
), | |
'capability_type' => 'post', | |
'has_archive' => true, | |
'hierarchical' => true, | |
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ) | |
); | |
register_post_type( 'name', $post_type_args ); | |
} | |
add_action( 'init', 'function_cpt' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment