Skip to content

Instantly share code, notes, and snippets.

@eddiemoya
Created September 17, 2012 21:04
Show Gist options
  • Save eddiemoya/3739764 to your computer and use it in GitHub Desktop.
Save eddiemoya/3739764 to your computer and use it in GitHub Desktop.
Example Custom Post Type
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