Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

GWC Departments

// Register Custom Taxonomy
function custom_taxonomy() {

	$labels = array(
		'name'                       => 'Departments',
		'singular_name'              => 'Department',
		'menu_name'                  => 'Departments',
		'all_items'                  => 'All Departments',
		'parent_item'                => 'Parent Department',
		'parent_item_colon'          => 'Parent Department:',
		'new_item_name'              => 'New Department Name',
		'add_new_item'               => 'Add New Department',
		'edit_item'                  => 'Edit Department',
		'update_item'                => 'Update Department',
		'separate_items_with_commas' => 'Separate departments with commas',
		'search_items'               => 'Search Departments',
		'add_or_remove_items'        => 'Add or remove departments',
		'choose_from_most_used'      => 'Choose from the most used departments',
		'not_found'                  => 'Not Found',
	);
	$rewrite = array(
		'slug'                       => 'departments',
		'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'              => false,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'tap_departments', array( 'tap_staff' ), $args );

}

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