Skip to content

Instantly share code, notes, and snippets.

@blainerobison
Last active December 30, 2015 11:59
Show Gist options
  • Save blainerobison/8bb58aa33089f729ffdd to your computer and use it in GitHub Desktop.
Save blainerobison/8bb58aa33089f729ffdd to your computer and use it in GitHub Desktop.
wp: Order admin menu items
/**
* Order Admin Menu Items
*/
function custom_menu_order( $menu_ord ) {
if ( ! $menu_ord ) {
return true;
}
return array(
'index.php', // Dashboard
'edit.php?post_type=page', // Pages
'edit.php?post_type=your_custom_post_type_name', // Custom type one
'edit.php?post_type=your_custom_post_type_name', // Custom type two
'edit.php?post_type=your_custom_post_type_name', // Custom type three
'separator1', // First separator
'edit.php', // Posts
'upload.php', // Media
'link-manager.php', // Links
'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', 'custom_menu_order' ); // Activate custom_menu_order
add_filter( 'menu_order', 'custom_menu_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment