AE Spink – Product Cats
// Register Custom Taxonomy
function custom_taxonomy_product_cat() {
$labels = array(
'name' => _x( 'Product Categories', 'Taxonomy General Name', '_themename' ),
'singular_name' => _x( 'Product Category', 'Taxonomy Singular Name', '_themename' ),
'menu_name' => __( 'Product Categories', '_themename' ),
'all_items' => __( 'All Categories', '_themename' ),
'parent_item' => __( 'Parent Category', '_themename' ),
'parent_item_colon' => __( 'Parent Category:', '_themename' ),
'new_item_name' => __( 'New Category Name', '_themename' ),
'add_new_item' => __( 'Add New Category', '_themename' ),
'edit_item' => __( 'Edit Category', '_themename' ),
'update_item' => __( 'Update Category', '_themename' ),
'view_item' => __( 'View Category', '_themename' ),
'separate_items_with_commas' => __( 'Separate Categories with commas', '_themename' ),
'add_or_remove_items' => __( 'Add or remove Categories', '_themename' ),
'choose_from_most_used' => __( 'Choose from the most used', '_themename' ),
'popular_items' => __( 'Popular Categories', '_themename' ),
'search_items' => __( 'Search Categories', '_themename' ),
'not_found' => __( 'Not Found', '_themename' ),
'no_terms' => __( 'No Categories', '_themename' ),
'items_list' => __( 'Categories list', '_themename' ),
'items_list_navigation' => __( 'Categories list navigation', '_themename' ),
);
$rewrite = array(
'slug' => 'product-category',
'with_front' => true,
'hierarchical' => true,
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'rewrite' => $rewrite,
'show_in_rest' => true,
);
register_taxonomy( 'ae_product_cat', array( 'ae_product' ), $args );
}
add_action( 'init', 'custom_taxonomy_product_cat', 0 );