Video Custom Post – StrateusisWidgets
// Register Custom Post Type
function custom_post_type_video() {
$labels = array(
'name' => 'Videos',
'singular_name' => 'Video',
'menu_name' => 'Video',
'parent_item_colon' => 'Parent Video:',
'all_items' => 'All Videos',
'view_item' => 'View Video',
'add_new_item' => 'Add New Video',
'add_new' => 'Add New',
'edit_item' => 'Edit Video',
'update_item' => 'Update Video',
'search_items' => 'Search Videos',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
);
$args = array(
'label' => 'post_type_video',
'description' => 'Video Links',
'labels' => $labels,
'supports' => array( 'title', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-video-alt',
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'post_type_video', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_type_video', 0 );