Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('init', 'registerCustomTaxonomies');
- function registerCustomTaxonomies() {
- register_taxonomy(
- 'products',
- 'product', [
- 'label' => 'Product Categories',
- 'has_archive' => false,
- 'hierarchical' => true,
- 'rewrite' => [
- 'slug' => 'products',
- ],
- ]
- );
- }
- add_action('init', 'addTaxonomiesToPages');
- function addTaxonomiesToPages() {
- register_taxonomy_for_object_type('products', 'product');
- }
- flush_rewrite_rules();
Add Comment
Please, Sign In to add comment