Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Cocktail Difficulty Levels

if ( ! function_exists( 'cocktail_difficulty_taxonomy' ) ) {

// Register Custom Taxonomy
function cocktail_difficulty_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Difficulties', 'Taxonomy General Name', 'gustologist' ),
		'singular_name'              => _x( 'Difficulty', 'Taxonomy Singular Name', 'gustologist' ),
		'menu_name'                  => __( 'Difficulty', 'gustologist' ),
		'all_items'                  => __( 'All Difficulties', 'gustologist' ),
		'parent_item'                => __( 'Parent Difficulty', 'gustologist' ),
		'parent_item_colon'          => __( 'Parent Difficulty:', 'gustologist' ),
		'new_item_name'              => __( 'New Difficulty', 'gustologist' ),
		'add_new_item'               => __( 'Add Difficulty', 'gustologist' ),
		'edit_item'                  => __( 'Edit Difficulty', 'gustologist' ),
		'update_item'                => __( 'Update Difficulty', 'gustologist' ),
		'view_item'                  => __( 'View Difficulty', 'gustologist' ),
		'separate_items_with_commas' => __( 'Separate difficulties with commas', 'gustologist' ),
		'add_or_remove_items'        => __( 'Add or remove difficulties', 'gustologist' ),
		'choose_from_most_used'      => __( 'Choose from the most used difficulties', 'gustologist' ),
		'popular_items'              => __( 'Popular difficulties', 'gustologist' ),
		'search_items'               => __( 'Search difficulties', 'gustologist' ),
		'not_found'                  => __( 'Not Found', 'gustologist' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'ct_difficulty', array( 'cocktails' ), $args );

}

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

}