Created
September 17, 2012 21:04
-
-
Save eddiemoya/3739764 to your computer and use it in GitHub Desktop.
Example Custom Post Type
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
public function register_video_type() { | |
$labels = array( | |
'name' => _x('Video', 'post type general name'), | |
'singular_name' => _x('Video', 'post type singular name'), | |
'add_new' => _x('Add New', 'section'), | |
'add_new_item' => __('Add New Video'), | |
'edit_item' => __('Edit Video'), | |
'new_item' => __('New Video'), | |
'all_items' => __('All Videos'), | |
'view_item' => __('View Video'), | |
'search_items' => __('Search Videos'), | |
'not_found' => __('No videos found'), | |
'not_found_in_trash' => __('No videos found in Trash'), | |
'parent_item_colon' => '', | |
'menu_name' => 'Videos' | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'has_archive' => true, | |
'menu_position' => 3, | |
'supports' => array('title', 'editor', 'comments'), | |
'taxonomies' => array('category'), | |
); | |
register_post_type('video', $args); | |
} | |
add_action( 'init', 'register_video_type'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment