Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

ingredient_taxonomy

// Register Custom Taxonomy
function ingredient_taxonomy() {

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

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