投稿のすぐ下に他のカスタム投稿タイプのメニューを追加するには、register_post_typeを使用する際に、menu_positionを6にしてやる。
functions.phpに次のように書くと投稿のすぐ下に追加される。
/**
* @return void
*/
function custom_custom_post_type() {
register_post_type('product',
array(
'labels' => array(
'name' => '商品',
'singular_name' => '商品',
),
'public' => true,
'has_archive' => true,
'menu_position' => 5,
)
);
}
add_action('init', 'custom_custom_post_type');
管理画面各メニューのポジションは決まっている。
5 – 投稿
10 – メディア
15 – リンク
20 – 固定ページ
25 – コメント
60 – 外観(テーマ)
65 – プラグイン
70 – ユーザー
75 – ツール
80 – 設定
EC-CUBEゴールドパートナー