您可以处理wp_taxonomies
对象期间init
行动然后可以更改categories 和posts tags.
function wpse292282_rename_default_taxonomies() {
global $wp_taxonomies;
// Update datas for Category
$labels = &$wp_taxonomies[\'category\']->labels;
$labels->name = \'Sector\';
$labels->singular_name = \'Sector\';
$labels->add_new = \'Add Sector\';
$labels->add_new_item = \'Add Sector\';
$labels->edit_item = \'Edit Sector\';
$labels->new_item = \'Sector\';
$labels->view_item = \'View Sector\';
$labels->search_items = \'Search Sectors\';
$labels->not_found = \'No Sectors found\';
$labels->not_found_in_trash = \'No Sectors found in Trash\';
$labels->all_items = \'All Sectors\';
$labels->menu_name = \'Sector\';
$labels->name_admin_bar = \'Sector\';
// Update datas for Tags
$labels = &$wp_taxonomies[\'post_tag\']->labels;
$labels->name = \'Technologies\';
$labels->singular_name = \'Technology\';
$labels->add_new = \'Add Technology\';
$labels->add_new_item = \'Add Technology\';
$labels->edit_item = \'Edit Technology\';
$labels->new_item = \'Technology\';
$labels->view_item = \'View Technology\';
$labels->search_items = \'Search Technologies\';
$labels->not_found = \'No Technologies found\';
$labels->not_found_in_trash = \'No Technologies found in Trash\';
$labels->all_items = \'All Technologies\';
$labels->menu_name = \'Technologies\';
$labels->name_admin_bar = \'Technologies\';
}
add_action( \'init\', \'wpse292282_rename_default_taxonomies\' );