Reorder the Admin Menu
Puts the admin menu items you use most at the top, in the order you choose. Everything else keeps its place below.
Opens WPIDE on
Code
// Menu slugs in the order you want them at the top of the menu.
$wpide_menu_order = array(
'index.php',
'separator1',
'edit.php?post_type=page',
'edit.php',
'upload.php',
);
add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', function ( $order ) use ( $wpide_menu_order ) {
if ( ! is_array( $order ) ) {
return $order;
}
$first = array_values( array_intersect( $wpide_menu_order, $order ) );
return array_merge( $first, array_values( array_diff( $order, $first ) ) );
} );
Notes
Find a slug by hovering a menu item: it is the part of the link after /wp-admin/.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.