Custom Post – Videos
if ( ! function_exists('custom_post_videos') ) {
// Register Custom Post Type
function custom_post_videos() {
$labels = array(
'name' => 'Videos',
'singular_name' => 'Video',
'menu_name' => 'Videos',
'parent_item_colon' => 'Parent Video:',
'all_items' => 'All Items',
'view_item' => 'View Video',
'add_new_item' => 'Add New Video',
'add_new' => 'Add Video',
'edit_item' => 'Edit Video',
'update_item' => 'Update Video',
'search_items' => 'Search Video',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
);
$rewrite = array(
'slug' => 'videos',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => 'jsa_videos',
'description' => 'Television Commercials & Other Videos',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'ctax_vid_cat', ' ctax_vid_tag' ),
'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' => '/jsa-assets/admin/videos.png',
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => '',
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'jsa_videos', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_videos', 0 );
}