• Resolved Andrew Tegenkamp

    (@andrewteg)


    I added a custom top level menu with add_menu_page and it works great. I then added a custom post type and used ‘show_in_menu’ to add the custom post type to that custom menu and now that is taking over the default admin screen for my top level menu. Is there any around this behavior in WordPress? Before the CPT admin.php?page=custompage was the default for my custom menu but now it is edit.php?post_type=book which I only want as a submenu item.

    I have minimal code to recreate the problem using code from the codex at http://tegenkamp.com/wp-content/plugins/cptdev/cptdev.php.txt to help anyone wishing to recreate the issue on a development installation.

    Thanks,
    Andrew

Viewing 1 replies (of 1 total)
  • Thread Starter Andrew Tegenkamp

    (@andrewteg)

    Interestingly I just found that the add_action on admin_menu that contains the add_menu_page can be set to priority 9 (or likely lower since the default is 10) in order to have the original add_menu_page item show up and have a custom post type added with register_post_type show up as a submenu item (as I expected) and not take over the first menu item.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Type in Custom Menu’ is closed to new replies.