Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function prefix_register_post_type_taxes() {
- $labels = array(
- 'name' => __('Categories', '@@textDomain') ,
- 'singular_name' => __('Category', '@@textDomain') ,
- 'menu_name' => __('Categories', '@@textDomain') ,
- 'all_items' => __('All Categories', '@@textDomain') ,
- 'edit_item' => __('Edit Category', '@@textDomain') ,
- 'view_item' => __('View Category', '@@textDomain') ,
- 'update_item' => __('Update Category Name', '@@textDomain') ,
- 'add_new_item' => __('Add New Category', '@@textDomain') ,
- 'new_item_name' => __('New Category Name', '@@textDomain') ,
- 'parent_item' => __('Parent Category', '@@textDomain') ,
- 'parent_item_colon' => __('Parent Category:', '@@textDomain') ,
- 'search_items' => __('Search Categories', '@@textDomain') ,
- 'popular_items' => __('Popular Categories', '@@textDomain') ,
- 'separate_items_with_commas' => __('Separate Categories with Commas', '@@textDomain') ,
- 'add_or_remove_items' => __('Add or remove Categories', '@@textDomain') ,
- 'choose_from_most_used' => __('Choose from the most used Categories', '@@textDomain') ,
- 'not_found' => __('No Categories found', '@@textDomain') ,
- 'no_terms' => __('No categories', '@@textDomain') ,
- 'items_list_navigation' => __('Categories list Navigation', '@@textDomain') ,
- 'items_list' => __('Categories list', '@@textDomain')
- );
- $args = array(
- 'label' => __('Categories', '@@textDomain') ,
- 'labels' => $labels,
- 'public' => TRUE,
- 'hierarchical' => TRUE,
- 'show_ui' => TRUE,
- 'show_in_menu' => TRUE,
- 'show_in_nav_menus' => TRUE,
- 'query_var' => TRUE,
- 'show_admin_column' => FALSE,
- 'show_in_rest' => FALSE,
- 'show_in_quick_edit' => FALSE,
- 'rest_base' => '',
- 'rewrite' => array(
- 'slug' => 'post_type_categories',
- 'with_front' => TRUE
- ) ,
- );
- register_taxonomy('post_type_categories', array(
- 'post_type'
- ) , $args);
- }
- add_action('init', 'prefix_register_post_type_taxes');
Add Comment
Please, Sign In to add comment