Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

BuS2Bus 50%

BuS2Bus 50%

// Register Custom Taxonomy
function business_to_business_taxonomy() {

	$labels = array(
		'name'                       => '(B2B)',
		'singular_name'              => '(B2B)',
		'menu_name'                  => 'business_to_business',
		'all_items'                  => 'All (B2B) Listings',
		'parent_item'                => 'Parent (B2B)',
		'parent_item_colon'          => 'Parent (B2B):',
		'new_item_name'              => 'New (B2B) Listing',
		'add_new_item'               => 'Add A New (B2B) Listing',
		'edit_item'                  => 'Edit (B2B) Listing',
		'update_item'                => 'Update Listing',
		'view_item'                  => 'View Listing',
		'separate_items_with_commas' => 'Separate (B2B) Listing with commas',
		'add_or_remove_items'        => 'Add or Remove B2B Items',
		'choose_from_most_used'      => 'Choose From Most Used (B2B)',
		'popular_items'              => 'Most Popular (B2B)',
		'search_items'               => 'Search (B2B) Items',
		'not_found'                  => 'Not Found',
		'no_terms'                   => 'No b2b items',
		'items_list'                 => '(B2B) list',
		'items_list_navigation'      => '(B2B) list navigation',
	);
	$rewrite = array(
		'slug'                       => 'shop/b2b/products',
		'with_front'                 => true,
		'hierarchical'               => true,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'query_var'                  => 'b2b/products',
		'rewrite'                    => $rewrite,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'business_to_business', array( 'post', 'product', 'stores', 'business_to_business' ), $args );

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