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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.