Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

SLASH9.tv Vimeo Archive

This is for SLASH9’s Vimeo Archive – a custom post type

if ( ! function_exists('slash9_mu_costum_posttypes_init') ) {

// Register Custom Post Type
function slash9_mu_costum_posttypes_init() {

	$labels = array(
		'name'                => _x( 'Vimeo Archive Videos', 'Post Type General Name', 'slash9' ),
		'singular_name'       => _x( 'Archive Video', 'Post Type Singular Name', 'slash9' ),
		'menu_name'           => __( 'Archive', 'slash9' ),
		'parent_item_colon'   => __( 'Parent Video:', 'slash9' ),
		'all_items'           => __( 'All Videos', 'slash9' ),
		'view_item'           => __( 'View Video', 'slash9' ),
		'add_new_item'        => __( 'Add New Video', 'slash9' ),
		'add_new'             => __( 'Add New', 'slash9' ),
		'edit_item'           => __( 'Edit Video', 'slash9' ),
		'update_item'         => __( 'Update Video', 'slash9' ),
		'search_items'        => __( 'Search Archive', 'slash9' ),
		'not_found'           => __( 'Not found', 'slash9' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'slash9' ),
	);
	$rewrite = array(
		'slug'                => 'archive',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => __( 'vi_archive', 'slash9' ),
		'description'         => __( 'This is SLASH9's Vimeo Archive', 'slash9' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'thumbnail', 'trackbacks', 'revisions', 'custom-fields', ),
		'taxonomies'          => array( 'category' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 60,
		'menu_icon'           => 'dashicons-video-alt2',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'query_var'           => 'vi_archive',
		'rewrite'             => $rewrite,
		'capability_type'     => 'post',
	);
	register_post_type( 'vi_archive', $args );

}

// Hook into the 'init' action
add_action( 'init', 'slash9_mu_costum_posttypes_init', 0 );

}