Modify post label

PHP
function modify_post_label_name() {
  $new_name = '新的名稱';
  $get_post_type = get_post_type_object('post');
  $labels = $get_post_type->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', array( $admin, 'modify_post_label_name' ) );

Tags: