Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Video Categories

Video Categories

if ( ! function_exists( 'custom_taxonomy' ) ) {

// Register Custom Taxonomy
function custom_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Video Categories', 'Taxonomy General Name', 'shoptube' ),
		'singular_name'              => _x( 'Video Category', 'Taxonomy Singular Name', 'shoptube' ),
		'menu_name'                  => __( 'Video Categories', 'shoptube' ),
		'all_items'                  => __( 'All Video Categories', 'shoptube' ),
		'parent_item'                => __( 'Parent Video Category', 'shoptube' ),
		'parent_item_colon'          => __( 'Parent Item:', 'shoptube' ),
		'new_item_name'              => __( 'New Video Category', 'shoptube' ),
		'add_new_item'               => __( 'Add New Video Category', 'shoptube' ),
		'edit_item'                  => __( 'Edit Video Category', 'shoptube' ),
		'update_item'                => __( 'Update Video Category', 'shoptube' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'shoptube' ),
		'search_items'               => __( 'Search Video Categories', 'shoptube' ),
		'add_or_remove_items'        => __( 'Add or remove Video Categories', 'shoptube' ),
		'choose_from_most_used'      => __( '', 'shoptube' ),
		'not_found'                  => __( 'Video Category Not Found', 'shoptube' ),
	);
	$rewrite = array(
		'slug'                       => 'video-category',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$capabilities = array(
		'manage_terms'               => 'manage_video_categories',
		'edit_terms'                 => 'edit_video_categories',
		'delete_terms'               => 'delete_video Categories',
		'assign_terms'               => 'assign_video_categories',
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
		'rewrite'                    => $rewrite,
		'capabilities'               => $capabilities,
	);
	register_taxonomy( 'taxonomy', 'custom_post_type', $args );

}

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

}