Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Whisk Taxonomy

// Register Custom Taxonomy
function custom_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Cuisines', 'Taxonomy General Name', 'whisk-recipes' ),
		'singular_name'              => _x( 'Cuisine', 'Taxonomy Singular Name', 'whisk-recipes' ),
		'menu_name'                  => __( 'Cuisines', 'whisk-recipes' ),
		'all_items'                  => __( 'All cuisines', 'whisk-recipes' ),
		'parent_item'                => __( 'Parent cuisine', 'whisk-recipes' ),
		'parent_item_colon'          => __( 'Parent cuisine:', 'whisk-recipes' ),
		'new_item_name'              => __( 'New cuisine', 'whisk-recipes' ),
		'add_new_item'               => __( 'Add cuisine', 'whisk-recipes' ),
		'edit_item'                  => __( 'Edit cuisine', 'whisk-recipes' ),
		'update_item'                => __( 'Update cuisine', 'whisk-recipes' ),
		'view_item'                  => __( 'View cuisine', 'whisk-recipes' ),
		'separate_items_with_commas' => __( 'Separate cuisines with commas', 'whisk-recipes' ),
		'add_or_remove_items'        => __( 'Add or remove cuisines', 'whisk-recipes' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'whisk-recipes' ),
		'popular_items'              => __( 'Popular cuisines', 'whisk-recipes' ),
		'search_items'               => __( 'Search cuisines', 'whisk-recipes' ),
		'not_found'                  => __( 'Not Found', 'whisk-recipes' ),
		'no_terms'                   => __( 'No cuisines', 'whisk-recipes' ),
		'items_list'                 => __( 'Cuisines list', 'whisk-recipes' ),
		'items_list_navigation'      => __( 'Cuisines list navigation', 'whisk-recipes' ),
	);
	$rewrite = array(
		'slug'                       => 'cuisines',
		'with_front'                 => true,
		'hierarchical'               => true,
	);
	$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,
		'show_in_rest'               => true,
		'rest_base'                  => 'cuisines',
	);
	register_taxonomy( 'cuisine', array( 'post' ), $args );

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