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?
- Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
- Customize Edit Post screen for Custom Post Types?
- Filter by custom field in custom post type on admin page
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Multiple custom post types under one admin menu
- How can I change the admin search posts fields?
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- Add separator to admin submenu
- Creating “static” taxonomies to choose from, inside custom post type?
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How can I filter posts by post_parent in the admin?
- Filter admin columns by custom post field value
- Is it OK to move admin menu items?
- Custom Post Type Menus
- Get page by template?
- How can I get my Custom Post Types to appear in nav-menus.php ‘Menu’?
- Extend walker class with custom post types [closed]
- Filter by custom Field for Custom post type Admin Listing
- automatically placing custom post types singles into submenu of main nav menu
- How to Programically add to the new WordPress menus
- How to get search results in the backend admin on a custom post type?
- No results searching custom post type in admin panel
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Change admin post thumbnail size for custom post type only
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- Editor access to menu: custom post type missing
- WordPress User Roles, Custom Post Types, and Admin views
- Remove current_page_parent from posts page link in WordPress nav menu
- Menu highlight custom post type archive
- Add the current menu item CSS class to a custom page type archive in WordPress menu
- Changing ‘view’ link for custom post type on list post screen?
- Menu Multiple Taxonomies
- Add html to cpt main page / admin edit.php
- Remove rows in the manage post/page view
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Set menu active state for custom posttype and category, given custom taxonomy term
- Access $post object when adding custom columns to list table
- Insert & order custom post types in/as submenu
- Correct classes for WordPress menu items
- Customize the Dashboard Menu Editor
- How to make this menu drop down or like accordion
- Get parse_query filter to return slug instead of id
- Custom Post Types don’t highlight in menu nav
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- On update or create post redirect to current post position in list
- Possibilities for the edit.php admin panel? [closed]
- How to display custom WP menus?
- Admin Column does not populate with data
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Single custom post type’s menu ancestor/parent is Posts archive page
- menu link to custom post_type?
- Custom Post Types in the WordPress Navigation Menu
- Add a ‘guide’ image to custom post type admin page
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- How can i automatically add CPT single pages as sub menu items
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- Custom Post Type Link added to menu won’t show in frontend
- Linking to Post Types from wp-admin
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- sortable columns for multiple custom post types not working
- Filter posts of custom post type by meta key in (List All Section)
- How to programmatically add elements in a custom menu
- Custom Posttype and menu classes
- Require custom post type if is_admin() – template doesn’t show up?
- using the loop in custom meta is messing up ‘add new’ post type
- Menu for taxonomies and posts belongs to taxonomy
- Display list of Custom Post
- How to create a Child & Siblings menu for a custom post type?
- Custom post type category link + add to menu
- Create an administation subpage containing posts in a certain category
- Navigation not working for custom post type pages
- Custom nav menu current item custom link problem
- Custom Post Type parent slug as menu item
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- Exclude categories For Custom post types
- List all posts from custom post type by taxonomy
- Redirect preview single post link to a page
- how to override menu widget?
- Collection of fields in a single post
- Show posts of parent in edit.php
- current_page_item and custom post type?
- Menu that shows months and filters posts to show only posts from that month and shows posts as sub items
- Display read only info on admin, custom post page
- sidebar hierarchical menu category & custom post type
- Navigation won’t update to show full path to single post
- How to set the Screen Options for Users in the Admin Panel?
- Issue displaying multiple TinyMCE editors with WPAlchemy
- Can’t add custom post type archive page to menu