Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

MVF-Video

// Register Custom Post Type
function custom_post_type_video() {

	$labels = array(
		'name'                  => _x( 'videos', 'Post Type General Name', 'mvf_video' ),
		'singular_name'         => _x( 'video', 'Post Type Singular Name', 'mvf_video' ),
		'menu_name'             => __( 'Videos', 'mvf_video' ),
		'name_admin_bar'        => __( 'Videos', 'mvf_video' ),
		'archives'              => __( 'Video Archives', 'mvf_video' ),
		'attributes'            => __( 'Video Attributes', 'mvf_video' ),
		'parent_item_colon'     => __( 'Parent Item:', 'mvf_video' ),
		'all_items'             => __( 'All Videos', 'mvf_video' ),
		'add_new_item'          => __( 'Add New Video', 'mvf_video' ),
		'add_new'               => __( 'Add New Video', 'mvf_video' ),
		'new_item'              => __( 'New Video', 'mvf_video' ),
		'edit_item'             => __( 'Edit Video', 'mvf_video' ),
		'update_item'           => __( 'Update Video', 'mvf_video' ),
		'view_item'             => __( 'View Video', 'mvf_video' ),
		'view_items'            => __( 'View Videos', 'mvf_video' ),
		'search_items'          => __( 'Search Videos', 'mvf_video' ),
		'not_found'             => __( 'Video Not found', 'mvf_video' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'mvf_video' ),
		'featured_image'        => __( 'Featured Image', 'mvf_video' ),
		'set_featured_image'    => __( 'Set featured image', 'mvf_video' ),
		'remove_featured_image' => __( 'Remove featured image', 'mvf_video' ),
		'use_featured_image'    => __( 'Use as featured image', 'mvf_video' ),
		'insert_into_item'      => __( 'Insert into item', 'mvf_video' ),
		'uploaded_to_this_item' => __( 'Uploaded to this item', 'mvf_video' ),
		'items_list'            => __( 'Items list', 'mvf_video' ),
		'items_list_navigation' => __( 'Items list navigation', 'mvf_video' ),
		'filter_items_list'     => __( 'Filter items list', 'mvf_video' ),
	);
	$rewrite = array(
		'slug'                  => 'post_type',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'video', 'mvf_video' ),
		'description'           => __( 'videos CPT for MVF-videos-plugin', 'mvf_video' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-editor-video',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => 'videos',
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => true,
	);
	register_post_type( 'videos', $args );

}
add_action( 'init', 'custom_post_type_video', 0 );