1

Been following Justin Tadlock's nice clear tutorial on how to have one custom post type act as a dropdown for another in the admin edit screen.

His example is of a restaurant CPT needing a dropdown to a neighbourhood CPT (btw, as the author points out in the comments, the reason not to just use a taxonomy is that the neighbourhood could have a bunch of custom fields not catered for by the built in taxonomy).

Here's the screenshot:

enter image description here

The tutorial code works perfectly on our site.

My question is, to keep the admin menu clean it would be nice to have everything sit under one root entry like so:

Places
 - Add New
 - Neighbourhoods

I only know how to add a root level CPT. So mine looks like this:

Places
  - Add New
Neighbourhoods
  - Add New

1 Answer 1

1

In your register_post_type call, use the argument show_in_menu:

register_post_type(
    'neighbourhood',
    array(
        'show_in_menu' => 'edit.php?post_type=place',
        // other args
    )
);
1
  • tried it, it works !
    – hawbsl
    Commented Apr 9, 2015 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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