Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Project Category Taxonomy

A category taxonomy for the Project CPT.

if ( ! function_exists( 'wf_tax_project_categories' ) ) {

// Register Custom Taxonomy
function wf_tax_project_categories() {

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

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

}