Yes you can do that. Use function add_menu_page http://codex.wordpress.org/Function_Reference/add_menu_page to add parent “All post types”, then use add_submenu_page http://codex.wordpress.org/Function_Reference/add_submenu_page to add pages to parent page:
add_action( 'admin_menu', 'my_custom_menu_page' );
function my_custom_menu_page() {
$slug = 'all-post';
add_menu_page( 'All post types', 'All post types', 'edit_posts', $slug, '__return_true' );
foreach( array( 'post', 'page', 'foo', 'bar' ) as $post_type ) {
$title = sprintf( 'Post type: %s', $post_type );
$url = sprintf('/edit.php?post_type=%s', $post_type);
add_submenu_page( $slug, $title, $title, 'edit_posts', $url );
}
}
Related Posts:
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- Settings page above CPT page in admin section
- wp_nav_menu() mark current item ancestor of custom post type
- Custom Post Type Nav to Subpage
- Using default WP menu functionality to link to custom post-type listing?
- Is there a way to establish parent/child relationship in WP menu links exclusively?
- How can I put content before my custom post type default pages?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Custom post type in submenu with custom meta box as a title with custom html
- How to make a single Menu Item call another Mega Menu for Custom Post Types and Custom Taxonomies?
- Options page – dropdown of users
- page menu entry for custom post type
- Possibilities for the edit.php admin panel? [closed]
- No Permission to add new Page, Post or CPT with Admin role
- How to display custom WP menus?
- Admin Column does not populate with data
- Filtering posts list table
- CPT Validation to not show “Post updated.”
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Use custom walker to add taxonomy terms to main nav menu
- A page that shows a list of a specific custom post type
- Single custom post type’s menu ancestor/parent is Posts archive page
- menu link to custom post_type?
- Review site custom post type structure
- Custom Post Types in the WordPress Navigation Menu
- Custom post type isn’t working
- Add a ‘guide’ image to custom post type admin page
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Ordering Submenu Pages in WP 3.1
- Including link to custom post type in ‘wp_list_pages’ function
- Which Template Page Should I Use?
- How can i automatically add CPT single pages as sub menu items
- Use remove_meta_box conditionally on custom post type
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- How can I use archive-{post_type}.php theme template?
- Custom Post Type Link added to menu won’t show in frontend
- How to group navigation items in the admin panel
- Add Labels to Admin Menu ( How To )
- Sortable column containing numeric values for Custom Post Type at WordPress Backend
- How To Display A List Of CPT Posts In A Meta Box On Menus Page?
- Get custom post type categories to show up in menus
- How to check if post/page or taxonomy post is published by admin
- How can I create an automatic drop down menu with my tags?
- show current item in custom menu, when inside a custom post type
- Linking to Post Types from wp-admin
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- WordPress menu with custom taxonomy
- Prevent custom post type from showing up in custom menus
- CPT Columns doesn’t show categories
- Is there a way to add the list of recent posts into the admin sub menu on hover?
- Insert Custom Post Types
- sortable columns for multiple custom post types not working
- Custom Post Type – Support “author” only for admins
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Add ‘page template’ column to dashboard for CPTs
- Custom Post Type – Portfolio no longer works
- How to get submenu of admin menu?
- Filter posts of custom post type by meta key in (List All Section)
- get_post_types not working properly in admin
- How to programmatically add elements in a custom menu
- Is there a hook between clicking on “Add new” and the edit screen of a new post?
- Custom Posttype and menu classes
- Require custom post type if is_admin() – template doesn’t show up?
- Function to add custom HTML into head in custom post-type list page
- Subpages Permalinks Issues
- highlight parent page menu item when in custom post type
- Multiple custom post types on same admin page
- using the loop in custom meta is messing up ‘add new’ post type
- Custom post type post in custom menu
- Custom post type posts wont show in wp_nav_menu()
- WordPress admin for a custom post, hide/collapse the main “title” and “description” boxes
- Home page is getting current-menu-item even if it’s not home
- Placing Admin Post Metaboxes in Tabs
- Add custom posts to submenu automatically
- Menu for taxonomies and posts belongs to taxonomy
- Display list of Custom Post
- Metaboxes inside Tab
- Is there any filter to add a custom attribute to the tag in admin panel?
- build child and anchestor three from post parent
- wordpress get menu id by custom post_type?
- cpt not display inside nav menu
- How to create a Child & Siblings menu for a custom post type?
- How to hide private posts even if user is admin
- wp_get_nav_menu_items doesn’t return custom post type item
- Adding orderby url parameter to main CPT admin menu link
- Automatically add CPT UI categories to the menu
- Help Adding filter to Add Media button for custom post type
- Custom post type category link + add to menu
- Delete all custom posts then upload a new CSV of events
- Pagination in wp-admin for CPT
- Possition a Custom Post Type Tab under Settings
- Create an administation subpage containing posts in a certain category
- Navigation not working for custom post type pages
- wp_nav_menu doesn’t seem to work on custom post type pages
- how to display notifications in the wordpress menu when a new post is published
- Custom nav menu current item custom link problem
- Custom post type doesn’t display on admin list
- Menu disappears with custom post type link