Guest User

Untitled

a guest
Sep 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <?php
  2.  
  3. function prefix_register_post_type_taxes() {
  4. $labels = array(
  5. 'name' => __('Categories', '@@textDomain') ,
  6. 'singular_name' => __('Category', '@@textDomain') ,
  7. 'menu_name' => __('Categories', '@@textDomain') ,
  8. 'all_items' => __('All Categories', '@@textDomain') ,
  9. 'edit_item' => __('Edit Category', '@@textDomain') ,
  10. 'view_item' => __('View Category', '@@textDomain') ,
  11. 'update_item' => __('Update Category Name', '@@textDomain') ,
  12. 'add_new_item' => __('Add New Category', '@@textDomain') ,
  13. 'new_item_name' => __('New Category Name', '@@textDomain') ,
  14. 'parent_item' => __('Parent Category', '@@textDomain') ,
  15. 'parent_item_colon' => __('Parent Category:', '@@textDomain') ,
  16. 'search_items' => __('Search Categories', '@@textDomain') ,
  17. 'popular_items' => __('Popular Categories', '@@textDomain') ,
  18. 'separate_items_with_commas' => __('Separate Categories with Commas', '@@textDomain') ,
  19. 'add_or_remove_items' => __('Add or remove Categories', '@@textDomain') ,
  20. 'choose_from_most_used' => __('Choose from the most used Categories', '@@textDomain') ,
  21. 'not_found' => __('No Categories found', '@@textDomain') ,
  22. 'no_terms' => __('No categories', '@@textDomain') ,
  23. 'items_list_navigation' => __('Categories list Navigation', '@@textDomain') ,
  24. 'items_list' => __('Categories list', '@@textDomain')
  25. );
  26. $args = array(
  27. 'label' => __('Categories', '@@textDomain') ,
  28. 'labels' => $labels,
  29. 'public' => TRUE,
  30. 'hierarchical' => TRUE,
  31. 'show_ui' => TRUE,
  32. 'show_in_menu' => TRUE,
  33. 'show_in_nav_menus' => TRUE,
  34. 'query_var' => TRUE,
  35. 'show_admin_column' => FALSE,
  36. 'show_in_rest' => FALSE,
  37. 'show_in_quick_edit' => FALSE,
  38. 'rest_base' => '',
  39. 'rewrite' => array(
  40. 'slug' => 'post_type_categories',
  41. 'with_front' => TRUE
  42. ) ,
  43. );
  44. register_taxonomy('post_type_categories', array(
  45. 'post_type'
  46. ) , $args);
  47. }
  48.  
  49. add_action('init', 'prefix_register_post_type_taxes');
Add Comment
Please, Sign In to add comment