管理画面のメニューを並び替える

// メニューの並び替え

function custom_menu_order($menu_ord) {

if (!$menu_ord) return true;

return array(

'index.php', // ダッシュボード

'separator1', // 仕切り

'edit.php', // 投稿

'edit.php?post_type=page', // 固定ページ

'separator-last', // 仕切り

'upload.php', // メディア

);

}

add_filter('custom_menu_order', 'custom_menu_order');

add_filter('menu_order', 'custom_menu_order');

投稿と固定ページは上の方にまとまってた方がわかりやすいので

まとめる時など

カスタム投稿タイプを作っている場合は以下のように追加できます

// メニューの並び替え

function custom_menu_order($menu_ord) {

if (!$menu_ord) return true;

return array(

'index.php', // ダッシュボード

'separator1', // 仕切り

'edit.php', // お知らせ

'edit.php?post_type=page', // 固定ページ

'edit.php?post_type=posttype01', // posttype01ページ

'edit.php?post_type=posttype02', // posttype02ページ

'edit.php?post_type=posttype03', // posttype03ページ

'edit.php?post_type=posttype04', // posttype04ページ

'edit.php?post_type=posttype05', // posttype05ページ

'separator-last', // 仕切り

'upload.php', // メディア

);

}

add_filter('custom_menu_order', 'custom_menu_order');

add_filter('menu_order', 'custom_menu_order');