Add Post type menu to another menu

I’ve created a menu page in the dashboard, then I created a custom post type and now I want to put the menu of the custom post type as a submenu under the first menu page I had created. I tried

‘show_in_menu’ => ‘admin.php?page=mytestpage’,

Read More

However that did not work. Any tips?

Related posts

Leave a Reply

2 comments

  1. You only need to add the page slug to “show_in_menu”, making the answer to your example:

    'show_in_menu' => 'mytestpage',
    

    For a more complete example:

    Admin/Settings page of: /wp-admin/admin.php?page=mytestpage

    register_post_type('mycpt', array('label' => 'My Custom Post Type', 'capability_type' => 'post', 'show_ui' => true, 'show_in_menu' => 'mytestpage'));