Automatically Add CPT to Menus?

General Discussion 3 posts 2 voices

  1. In the menus admin area you have a checkbox for..

    Auto add pages 
    Automatically add new top-level pages to this menu

    Is it possible to automatically add a CPT the same way or is this not possible?

  2. WordPress doesn’t have any hooks or other easy methods for developers to add this for CPTs. The only way to do it would probably be to completely recreate it in your plugin.

    If you don’t need the checkbox and just want to hardcode it, you could just recreate the _wp_auto_add_pages_to_menu() action for your CPT.