Guest User

Untitled

a guest
Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. add_action('init', 'registerCustomTaxonomies');
  2. function registerCustomTaxonomies() {
  3. register_taxonomy(
  4. 'products',
  5. 'product', [
  6. 'label' => 'Product Categories',
  7. 'has_archive' => false,
  8. 'hierarchical' => true,
  9. 'rewrite' => [
  10. 'slug' => 'products',
  11. ],
  12. ]
  13. );
  14. }
  15.  
  16. add_action('init', 'addTaxonomiesToPages');
  17. function addTaxonomiesToPages() {
  18. register_taxonomy_for_object_type('products', 'product');
  19. }
  20.  
  21. flush_rewrite_rules();
Add Comment
Please, Sign In to add comment