I have a simple solution in my functions.php for reordering the admin menu. Here it is:
// Admin menu - reorder
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=shop_order', // WooCommerce
'edit.php?post_type=product', // Products
'gf_edit_forms', // Forms
'upload.php', // Media
'separator1', // First separator
'separator2', // Second separator
'separator-last', // Last separator
'users.php', // Users
'themes.php', // Appearance
'options-general.php', // Settings
'plugins.php', // Plugins
'tools.php', // Tools
'itsec', // Security
'edit.php?post_type=acf-field-group', // Custom Fields
'edit.php?post_type=cptm' // Post types
);
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');
This works just fine, except this one item does not work:
'edit.php?post_type=shop_order', // WooCommerce
It just shows up at the bottom of the menu, everything I try to do to make it show up in the proper order fails. I believe the issue is the post_type name shop_order. It's the underscore that I think is making it fail.
Any thoughts on why that might be? Please don't say to use a plugin as the goal of this is to avoid using additional plugins. Thank you!