Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Spirits Taxonomy for Cocktail Slices Drinks CPT

if ( ! function_exists( 'tax_spirit' ) ) {

// Register Custom Taxonomy
function tax_spirit() {

	$labels = array(
		'name'                       => _x( 'Spirits', 'Taxonomy General Name', 'bhiframework' ),
		'singular_name'              => _x( 'Spirit', 'Taxonomy Singular Name', 'bhiframework' ),
		'menu_name'                  => __( 'Spirit', 'bhiframework' ),
		'all_items'                  => __( 'All Spirits', 'bhiframework' ),
		'parent_item'                => __( 'Parent Spirit', 'bhiframework' ),
		'parent_item_colon'          => __( 'Parent Spirit:', 'bhiframework' ),
		'new_item_name'              => __( 'New Spirit Name', 'bhiframework' ),
		'add_new_item'               => __( 'Add New Spirit', 'bhiframework' ),
		'edit_item'                  => __( 'Edit Spirit', 'bhiframework' ),
		'update_item'                => __( 'Update Spirit', 'bhiframework' ),
		'view_item'                  => __( 'View Spirit', 'bhiframework' ),
		'separate_items_with_commas' => __( 'Separate spirits with commas', 'bhiframework' ),
		'add_or_remove_items'        => __( 'Add or remove spirits', 'bhiframework' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'bhiframework' ),
		'popular_items'              => __( 'Popular Spirits', 'bhiframework' ),
		'search_items'               => __( 'Search Spirits', 'bhiframework' ),
		'not_found'                  => __( 'Not Found', 'bhiframework' ),
		'no_terms'                   => __( 'No spirits', 'bhiframework' ),
		'items_list'                 => __( 'Spirits list', 'bhiframework' ),
		'items_list_navigation'      => __( 'Spirits list navigation', 'bhiframework' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'spirit', array( 'drinks' ), $args );

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

}