Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Project Status Taxonomy

Add a status to Project CPT

if ( ! function_exists( 'tf_projects_status_tax' ) ) {

// Register Custom Taxonomy
function tf_projects_status_tax() {

	$labels = array(
		'name'                       => 'Stati',
		'singular_name'              => 'Project Status',
		'menu_name'                  => 'Status',
		'all_items'                  => 'All Stati',
		'parent_item'                => 'Parent Status',
		'parent_item_colon'          => 'Parent Status:',
		'new_item_name'              => 'New Status Name',
		'add_new_item'               => 'Add New Status',
		'edit_item'                  => 'Edit Status',
		'update_item'                => 'Update Status',
		'view_item'                  => 'View Status',
		'separate_items_with_commas' => 'Separate stati with commas',
		'add_or_remove_items'        => 'Add or remove a status',
		'choose_from_most_used'      => 'Choose from the most used',
		'popular_items'              => 'Popular Stati',
		'search_items'               => 'Search Project Stati',
		'not_found'                  => 'Status Not Found',
		'no_terms'                   => 'No stati',
		'items_list'                 => 'Status list',
		'items_list_navigation'      => 'Status list navigation',
	);
	$rewrite = array(
		'slug'                       => 'project-status',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => false,
		'rewrite'                    => $rewrite,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'tf_projects_status', array( 'tf_projects' ), $args );

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

}