Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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', '');
share|improve this question

1 Answer 1

up vote 0 down vote accepted

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', '');
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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