Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Product Brands (WC)

if ( ! function_exists( 'product_brands_tax' ) ) {

// Register Custom Taxonomy
function product_brands_tax() {

	$labels = array(
		'name'                       => _x( 'Brands', 'Taxonomy General Name', 'sgc' ),
		'singular_name'              => _x( 'Brand', 'Taxonomy Singular Name', 'sgc' ),
		'menu_name'                  => __( 'Brands', 'sgc' ),
		'all_items'                  => __( 'All Brands', 'sgc' ),
		'parent_item'                => __( 'Parent Brand', 'sgc' ),
		'parent_item_colon'          => __( 'Parent Brand:', 'sgc' ),
		'new_item_name'              => __( 'New Brand Name', 'sgc' ),
		'add_new_item'               => __( 'Add New Brand', 'sgc' ),
		'edit_item'                  => __( 'Edit Brand', 'sgc' ),
		'update_item'                => __( 'Update Brand', 'sgc' ),
		'view_item'                  => __( 'View Brand', 'sgc' ),
		'separate_items_with_commas' => __( 'Separate brands with commas', 'sgc' ),
		'add_or_remove_items'        => __( 'Add or remove brands', 'sgc' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'sgc' ),
		'popular_items'              => __( 'Popular Brands', 'sgc' ),
		'search_items'               => __( 'Search Brands', 'sgc' ),
		'not_found'                  => __( 'Not Found', 'sgc' ),
		'no_terms'                   => __( 'No brands', 'sgc' ),
		'items_list'                 => __( 'Brands list', 'sgc' ),
		'items_list_navigation'      => __( 'Brands list navigation', 'sgc' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'brand', array( 'product' ), $args );

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

}