Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Age Taxonomy

if ( ! function_exists( 'age_taxonomy' ) ) {

// Register Custom Taxonomy
function age_taxonomy() {

	$labels = array(
		'name'                       => 'Ages',
		'singular_name'              => 'Age',
		'menu_name'                  => 'Age',
		'all_items'                  => 'All Ages',
		'parent_item'                => 'Parent Age',
		'parent_item_colon'          => 'Parent Age:',
		'new_item_name'              => 'New Age Name',
		'add_new_item'               => 'Add New Age',
		'edit_item'                  => 'Edit Age',
		'update_item'                => 'Update Age',
		'view_item'                  => 'View Age',
		'separate_items_with_commas' => 'Separate ages with commas',
		'add_or_remove_items'        => 'Add or remove ages',
		'choose_from_most_used'      => 'Choose from the most used',
		'popular_items'              => 'Popular Ages',
		'search_items'               => 'Search Ages',
		'not_found'                  => 'Not Found',
		'no_terms'                   => 'No ages',
		'items_list'                 => 'Ages list',
		'items_list_navigation'      => 'Ages list navigation',
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'pet-age', array( 'pet' ), $args );

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

}