×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Ruhul Amin
Added: Aug 25, 2021 8:10 PM
Views: 3432
Tags: no tags
  1. add_filter( 'taxonomy_labels_portfolio_category', 'doctors_taxonomy_lebel_type_func', 300 );
  2. /**
  3.  * @param $labels
  4.  * @return mixed
  5.  */
  6. function doctors_taxonomy_lebel_type_func( $labels ) {
  7.  $labels->name          = 'Doctor type';
  8.  $labels->singular_name = 'Doctor types';
  9.  $labels->edit_item     = 'Edit Doctor types';
  10.  $labels->add_new_item  = 'Add New Doctor types';
  11.  $labels->search_items  = 'Search Doctor type';
  12.  $labels->update_item   = 'Update Doctor types';
  13.  $labels->menu_name     = 'Doctor type';
  14.  
  15.  return $labels;
  16. }
  17.  
  18. add_filter( 'register_taxonomy_args', 'wpdocs_my_taxonomy_args', 10, 2 );
  19. /**
  20.  * @param $args
  21.  * @param $taxonomy
  22.  * @return mixed
  23.  */
  24. function wpdocs_my_taxonomy_args( $args, $taxonomy ) {
  25.  
  26.  // Target "my-taxonomy"
  27.  if ( 'portfolio_tags' !== $taxonomy ) {
  28.   return $args;
  29.  }
  30.  
  31.  // Set Hierarchical
  32.  $args['hierarchical'] = true;
  33.  
  34.  // Return
  35.  
  36.  return $args;
  37. }