0

I have a situation where I want to add a second custom top-level menu for a custom post type.

So, when we have a CPT named "fruits", which registers a top level menu with a label of "Fruits", clicking on "Fruits" will take you to edit.php?post_type=fruits.

I'm trying to add a separate top-level menu with a label of "Oranges", and when I click that, it actually goes to 'edit.php?post_type=fruits&subtype=orange'. However, when adding the new menu the link always wants to point to "admin.php"...how can I get it to point to the edit url above?

edit: this seems to work , not sure if it's the best way or not: This actually seems to do the trick, not sure if it's the best way though:

add_menu_page('Oranges', 'Oranges', 'edit_posts', 'edit.php?post_type=fruits&subtype=oranges', '');
0

Answering my own question as noted in the edit:

This actually seems to do the trick, not sure if it's the best way though:

add_menu_page('Oranges', 'Oranges', 'edit_posts', 'edit.php?post_type=fruits&subtype=oranges', '');

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.