找到了解决方案,只需将此函数添加到您的functions.php
/*Change menu-order*/
add_filter( 'custom_menu_order', 'so_18766477_submenu_order' );
function so_18766477_submenu_order( $menu_ord )
{
global $submenu;
// Enable the next line to see all menu orders
//echo '<pre>'.print_r($submenu,true).'</pre>';
$arr = array();
$arr[] = $submenu['edit.php'][5]; //my original order was 5,10,15,16,17,18
$arr[] = $submenu['edit.php'][10];
$arr[] = $submenu['edit.php'][18];
$arr[] = $submenu['edit.php'][17];
$arr[] = $submenu['edit.php'][15];
$arr[] = $submenu['edit.php'][16];
$submenu['edit.php'] = $arr;
return $menu_ord;
}
在这里通过选择edit.php,我的目标是“帖子”菜单。您可以选择任何您希望对其子菜单进行重新排序的文件,例如 plugins.php、themes.php、tools.php 等