Admin submenu hidden on certain submenu pages


I’ve created a custom post type from a plugin. Then I added several submenu pages to its submenu list, like this:

add_submenu_page('Parent title', 'category_redirect', 'Categories', 'administrator',  'edit-tags.php?taxonomy=my-category&post_type=order_post_type');

add_submenu_page('Parent title', 'orders_redirect', 'Orders', 'administrator',  'edit.php?post_type=order_post_type');

//and several others
//hooked via the add_action('admin_menu') hook

The problem is that when I go to some of those pages, the submenu that contains the links is either collapsed (shown to the right of the main item when hovering over it), or expanded with no sumbenu links active. E.g. my submenu is not shown on the Categories page above, but shown on the ordpers page (another post type). How do I fix it?

tolkodelo 8 months 2020-12-06T02:11:16-05:00 0 Answers 10 views 0

Leave an answer