Help us understand the problem. What is going on with this article?

【WordPress・プラグインなし】管理画面にあるデフォルトの「投稿」の名前を変更する方法

管理画面にデフォルトで設定されている「投稿」は別の名前に変更することができます。
widgets.png :arrow_right: スクリーンショット 2019-04-12 12.18.09.png

functions.phpに以下を追加します。
$nameに変更したい名前を入れてください。

functions.php
function change_post_menu_label() {
  $name = '新着情報';
  global $menu;
  global $submenu;
  $menu[5][0] = $name;
  $submenu['edit.php'][5][0] = $name.'一覧';
  $submenu['edit.php'][10][0] = '新しい'.$name;
  $submenu['edit.php'][16][0] = 'タグ';
}
add_action( 'admin_menu', 'change_post_menu_label' );
function change_post_object_label() {
  $name = '新着情報';
  global $wp_post_types;
  $labels = &$wp_post_types['post']->labels;
  $labels->name = $name;
  $labels->singular_name = $name;
  $labels->add_new = '新規追加';
  $labels->add_new_item = $name.'の新規追加';
  $labels->edit_item = $name.'の編集';
  $labels->new_item = '新規'.$name;
  $labels->view_item = $name.'を表示';
  $labels->search_items = $name.'を検索';
  $labels->not_found = '記事が見つかりませんでした';
  $labels->not_found_in_trash = 'ゴミ箱に記事は見つかりませんでした';
  $menu_icon = &$wp_post_types['post']->menu_icon;
  $menu_icon = 'dashicons-star-filled';// アイコン
}
add_action('init', 'change_post_object_label');

アイコンは他にもたくさん種類があります。
https://developer.wordpress.org/resource/dashicons/

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした