Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CU Taxonomy Example

// Register Custom Taxonomy
function cu_register_people_type_taxonomies() {

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

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