Having read elsewhere on Stack of two WP plugins forcing identical menu positions (with the likelihood of one then not appearing), I'm wondering how I can control the position of menu items added by plugins.
I already use a function which seems to handle such submenu items in 'settings', and another function to reorder default (posts, pages, themes, plugins, settings, etcetera) 'top level' items - but which doesn't change the positioning of such items added by plugins.
function custom_menu_order() {
return array(
//Add items here in desired order.
);
}
add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', 'custom_menu_order' );
As an example, of the two top-level menu items added by WooCommerce, one appears above the item added by ContactForm7 and the other below, and it'd be nice to reorder them accordingly - and also, to be able to better reorder items which don't force a menu position and instead appear at the bottom.
I find it usually works fine for re-ordering default and 'edit.php?post_type=...' items, but those with 'admin.php?page=...' don't re-order.
When my re-order function is disabled, the two WooCommerce items ('edit.php?post_type=product', and 'edit.php?post_type=shop_order') group together as intended, but when the function is reactivated they're split by ContactForm7 ('admin.php?page=wpcf7').
And, one ('edit.php?post_type=shop_order') of the WooCommerce CPTs won't reorder - although the other ('edit.php?post_type=product') does.