I am trying to create a plugin, with a Dashboard page, config page, some extra pages for configuration and some custom post types.
More specific, in the admin I like to have some pages added in the menu via the functions add_menu_page and add_submenu_page, as well I like to create some custom post types related to the plugin.
The question is, how to group the custom post types menus under the plugin menu options.
In example, lets say I creating the menu option "MyPlugin" with the function add_menu_page and then below this menu I adding the pages "Settings Page", "Do stuff page", "Dashboard" via the function add_submenu_page and then I create the custom post type "Cars". How can I place the "Cars" menu under the MyPlugin menu option ?
The final result I like to be like that :
Dashboard
Home
...
Posts
All Posts
...
Settings
General
...
...
MyPlugin <- How to add this menu structure ?
Dashboard <- How to add this menu structure ?
Cars <- How to add this menu structure ?
Settings Page <- How to add this menu structure ?
Do stuff page <- How to add this menu structure ?
The actual issue is not how to create the menu structure, but how to add the "Cars" custom post type menu under the MyPlugin menu.
Note I have try the following option in the "register_post_type" attributes with no luck
'show_in_menu' => 'admin.php?page=myplugin.php'
Is that posible to achived ?