Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

The Field Federation custom taxonomies

// Register Custom Taxonomy
function theff_custom_taxonomies() {

	$labels = array(
		'name'                       => _x( 'Organisations', 'Taxonomy General Name', 'theff' ),
		'singular_name'              => _x( 'Organisation', 'Taxonomy Singular Name', 'theff' ),
		'menu_name'                  => __( 'Organisations', 'theff' ),
		'all_items'                  => __( 'All Organisations', 'theff' ),
		'parent_item'                => __( 'Parent Organisation', 'theff' ),
		'parent_item_colon'          => __( 'Parent Organisation:', 'theff' ),
		'new_item_name'              => __( 'New Organisation Name', 'theff' ),
		'add_new_item'               => __( 'Add New Organisation', 'theff' ),
		'edit_item'                  => __( 'Edit Organisation', 'theff' ),
		'update_item'                => __( 'Update Organisation', 'theff' ),
		'view_item'                  => __( 'View Organisation', 'theff' ),
		'separate_items_with_commas' => __( 'Separate Organisations with commas', 'theff' ),
		'add_or_remove_items'        => __( 'Add or remove Organisations', 'theff' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'theff' ),
		'popular_items'              => __( 'Popular Organisations', 'theff' ),
		'search_items'               => __( 'Search Organisations', 'theff' ),
		'not_found'                  => __( 'Not Found', 'theff' ),
	);
	$capabilities = array(
		'manage_terms'               => 'manage_organisations',
		'edit_terms'                 => 'manage_organisations',
		'delete_terms'               => 'manage_organisations',
		'assign_terms'               => 'edit_posts',
	);
	$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( 'organisation', array( 'news' ), $args );

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