I have a custom post type called meeting and I want to add its edit and list screens as separate submenu items under a custom menu item slug meetings_settings.
Here is my current menu setup
add_action('admin_menu', 'wf_meetings_menu');
function wf_meetings_menu() {
add_menu_page('Meetings', 'Meetings', 'manage_options', 'meetings_menu', 'meetings_settings');
add_submenu_page('meetings_menu', 'Meetings Settings', 'Settings', 'manage_options', 'meetings_menu_settings', 'meetings_settings');
// meetings list screen goes here
add_submenu_page('meetings_menu', 'All Meetings', 'All Meetings', 'manage_options', 'meetings_menu_all', 'meetings_all');
// meetings edit screen goes here
add_submenu_page('meetings_menu', 'New Meeting', 'New Meeting', 'manage_options', 'meetings_menu_new', 'meetings_new');
}
From research I see you can add a custom post type as a submenu by setting show_in_menu => 'edit.php?post_type=meeting' on the custom post type, and then setting the draw function for the submenu item to 'edit.php?post_type=meeting'. I'm a little confused with this part, because wouldn't that only include the edit screen for that post type? There are TWO screens for a custom post type: the edit screen and the list screen (plus categories and tags but I don't need those in this case).
How do you differentiate between the two and add both the edit and list screens for a custom post type as submenu items of a regular admin menu item like above?