Created
October 18, 2012 22:29
-
-
Save jeffsebring/3915159 to your computer and use it in GitHub Desktop.
Create Custom Post Type
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 | |
add_action( 'init', function() | |
{ | |
register_post_type( 'code', | |
array( | |
'labels' => array( | |
'name' => _x( 'Code', 'post type general name' ), | |
'singular_name' => _x( 'Code', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'Code' ), | |
'add_new_item' => __( 'Add New Code' ), | |
'edit_item' => __( 'Edit Code' ), | |
'new_item' => __( 'New Code' ), | |
'all_items' => __( 'All Code' ), | |
'view_item' => __( 'View Code' ), | |
'search_items' => __( 'Search Code' ), | |
'not_found' => __( 'No Code found' ), | |
'not_found_in_trash' => __( 'No Code found in Trash' ), | |
'parent_item_colon' => '', | |
'menu_name' => __( 'Code' ) | |
), | |
'public' => true, | |
'has_archive' => true, | |
'hierarchical' => false, | |
'capability_type' => 'post', | |
'supports' => array( | |
'title', | |
'editor', | |
'thumbnail', | |
'page-attributes' | |
) | |
) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment