Wordpress | Reorder Admin Menu
// REORDER MENU
add_filter('custom_menu_order', function() { return true; });
add_filter('menu_order', 'my_new_admin_menu_order');
function my_new_admin_menu_order( $menu_order ) {
$new_positions = array('index.php' => 1, 'edit.php' => 2, 'upload.php' => 7, 'edit.php?post_type=page' => 3, 'edit-comments.php' => 8);
function move_element(&$array, $a, $b) {
$out = array_splice($array, $a, 1);
array_splice($array, $b, 0, $out);
}
foreach( $new_positions as $value => $new_index ) {
if( $current_index = array_search( $value, $menu_order ) ) {
move_element($menu_order, $current_index, $new_index);
}
}
return $menu_order;
}