我想在新分类中添加产品类别库和%product_cat%我添加到woocomerce,有什么想法吗?
$flavour_labels = array(
'name' => 'Flavours',
'singular_name' => 'Flavour',
'menu_name' => 'Flavour',
'all_items' => 'All Flavours',
'parent_item' => 'Parent Flavour',
'parent_item_colon' => 'Parent Flavour:',
'new_item_name' => 'New Flavour Name',
'add_new_item' => 'Add New Flavour',
'edit_item' => 'Edit Flavour',
'update_item' => 'Update Flavour',
'separate_items_with_commas' => 'Separate Flavour with commas',
'search_items' => 'Search Flavours',
'add_or_remove_items' => 'Add or remove Flavours',
'choose_from_most_used' => 'Choose from the most used Flavours',
);
$flavour_args = array(
'labels' => $flavour_labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'flavour'),
);
register_taxonomy( 'product_flavour', 'product', $flavour_args );
register_taxonomy_for_object_type( 'product_flavour', 'product' );
这是我的网址 http://site.local/flavour/name/
这就是我想要的 http://site.local/gear/product_cat/flavour/name/
我不想在重写中编写任何代码