Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Centre

custom centre taxonomy

if ( ! function_exists( 'centre_custom_post_type' ) ) {

// Register Custom Taxonomy
function centre_custom_post_type() {

	$labels = array(
		'name'                       => _x( 'Centres', 'Taxonomy General Name', 'tw_unifriend' ),
		'singular_name'              => _x( 'Centre', 'Taxonomy Singular Name', 'tw_unifriend' ),
		'menu_name'                  => __( 'Centre', 'tw_unifriend' ),
		'all_items'                  => __( 'All Centres', 'tw_unifriend' ),
		'parent_item'                => __( 'Parent Centre', 'tw_unifriend' ),
		'parent_item_colon'          => __( 'Parent Centre:', 'tw_unifriend' ),
		'new_item_name'              => __( 'New Centre Name', 'tw_unifriend' ),
		'add_new_item'               => __( 'Add New Centre', 'tw_unifriend' ),
		'edit_item'                  => __( 'Edit Centre', 'tw_unifriend' ),
		'update_item'                => __( 'Update Centre', 'tw_unifriend' ),
		'view_item'                  => __( 'View Centre', 'tw_unifriend' ),
		'separate_items_with_commas' => __( 'Separate centres with commas', 'tw_unifriend' ),
		'add_or_remove_items'        => __( 'Add or remove centres', 'tw_unifriend' ),
		'choose_from_most_used'      => __( 'Choose from the most used centres', 'tw_unifriend' ),
		'popular_items'              => __( 'Popular centre', 'tw_unifriend' ),
		'search_items'               => __( 'Search centres', 'tw_unifriend' ),
		'not_found'                  => __( 'Not Found', 'tw_unifriend' ),
		'no_terms'                   => __( 'No centre', 'tw_unifriend' ),
		'items_list'                 => __( 'centres list', 'tw_unifriend' ),
		'items_list_navigation'      => __( 'centres list navigation', 'tw_unifriend' ),
	);
	$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'               => false,
	);
	register_taxonomy( 'centre', array( '' ), $args );

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

}