Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Contact Types Taxonomy

// Register Custom Taxonomy
function custom_taxonomy_contact_types() {

	$labels = array(
		'name'                       => _x( 'Contact Types', 'Taxonomy General Name', 'izanagi' ),
		'singular_name'              => _x( 'Contact Type', 'Taxonomy Singular Name', 'izanagi' ),
		'menu_name'                  => __( 'Contact Types', 'izanagi' ),
		'all_items'                  => __( 'All Contact Types', 'izanagi' ),
		'parent_item'                => __( '', 'izanagi' ),
		'parent_item_colon'          => __( '', 'izanagi' ),
		'new_item_name'              => __( 'New Contact Type Name', 'izanagi' ),
		'add_new_item'               => __( 'Add New Contact Type', 'izanagi' ),
		'edit_item'                  => __( 'Edit Contact Type', 'izanagi' ),
		'update_item'                => __( 'Update Contact Type', 'izanagi' ),
		'separate_items_with_commas' => __( 'Separate Contact Types with commas', 'izanagi' ),
		'search_items'               => __( 'Search Contact Types', 'izanagi' ),
		'add_or_remove_items'        => __( 'Add or remove Contact Types', 'izanagi' ),
		'choose_from_most_used'      => __( 'Choose from the most used contact types', 'izanagi' ),
		'not_found'                  => __( 'Not Found', 'izanagi' ),
	);
	$capabilities = array(
		'manage_terms'               => 'manage_contact_types',
		'edit_terms'                 => 'manage_contact_types',
		'delete_terms'               => 'manage_contact_types',
		'assign_terms'               => 'edit_contacts',
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'capabilities'               => $capabilities,
	);
	register_taxonomy( 'contact_types', array( 'contact' ), $args );

}

// Hook into the 'init' action
add_action( 'init', 'custom_taxonomy_contact_types', 0 );