Modify category label

PHP
function modify_category_tax_name(){
  $new_name = '新的名稱';
  global $wp_taxonomies;
  $labels = &$wp_taxonomies['category']->labels;
  $labels->name = $new_name;
  $labels->singular_name = $new_name;
  $labels->add_new = '新增'.$new_name;
  $labels->add_new_item = '新增'.$new_name;
  $labels->edit_item = '編輯'.$new_name;
  $labels->new_item = $new_name;
  $labels->view_item = '檢視'.$new_name;
  $labels->search_items = '搜尋'.$new_name;
  $labels->not_found = '無結果';
  $labels->not_found_in_trash = '無結果';
  $labels->all_items = '所有'.$new_name;
  $labels->menu_name = $new_name;
  $labels->name_admin_bar = $new_name;
}
add_action( 'init', 'modify_category_tax_name' );

Tags: