Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Food – Healthier Options – Tax

// Register Custom Taxonomy
function mi_food_healthier_options_tax() {

	$labels = array(
		'name'                       => _x( 'Healthier Options', 'Taxonomy General Name', 'mi-food' ),
		'singular_name'              => _x( 'Healthier Option', 'Taxonomy Singular Name', 'mi-food' ),
		'menu_name'                  => __( 'Healthier Option', 'mi-food' ),
		'all_items'                  => __( 'All Healthier Options', 'mi-food' ),
		'parent_item'                => __( 'Parent Healthier Option', 'mi-food' ),
		'parent_item_colon'          => __( 'Parent Healthier Option:', 'mi-food' ),
		'new_item_name'              => __( 'New Healthier Option', 'mi-food' ),
		'add_new_item'               => __( 'Add New Healthier Option', 'mi-food' ),
		'edit_item'                  => __( 'Edit Healthier Option', 'mi-food' ),
		'update_item'                => __( 'Update Healthier Option', 'mi-food' ),
		'view_item'                  => __( 'View Healthier Option', 'mi-food' ),
		'separate_items_with_commas' => __( 'Separate healthier option with commas', 'mi-food' ),
		'add_or_remove_items'        => __( 'Add or remove healthier options', 'mi-food' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'mi-food' ),
		'popular_items'              => __( 'Popular Healthier Options', 'mi-food' ),
		'search_items'               => __( 'Search Healthier Options', 'mi-food' ),
		'not_found'                  => __( 'Not Found', 'mi-food' ),
		'no_terms'                   => __( 'No healthier options', 'mi-food' ),
		'items_list'                 => __( 'Healthier options list', 'mi-food' ),
		'items_list_navigation'      => __( 'Healthier options list navigation', 'mi-food' ),
	);
	$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( 'healthier-options', array( 'food' ), $args );

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