Define WordPress Dashboard Menu Order
Aug 12, 2020 | WordPress
function xxx_custom_menu_order( $menu_xxx ) {
if ( !$menu_xxx ) return true;
return array(
'index.php', // Dashboard
'separator1', // First separator
'edit.php', // Posts
'edit.php?post_type=page', // Pages
'edit.php?post_type=xxx', // Custom. Replace xxx with post type.
'upload.php', // Media
'edit-comments.php', // Comments
'separator2', // Second separator
'themes.php', // Appearance
'plugins.php', // Plugins
'users.php', // Users
'tools.php', // Tools
'options-general.php', // Settings
'separator-last', // Last separator
);
}
add_filter( 'custom_menu_order', 'xxx_custom_menu_order', 10, 1 );
add_filter( 'menu_order', 'xxx_custom_menu_order', 10, 1 );
Allows you to put the WordPress dashboard menu items in a specific order.