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’,

However that did not work. Any tips?

2 Answers
2

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'));

Leave a Reply

Your email address will not be published. Required fields are marked *