I'm working on a plugin that sets admin menu submenu pages on all different post types.
I need to be able to associate these new submenu pages with the corresponding post type of the top level menu item. Is this possible without having to rely on using
I see that
$typenow is used on
edit.php, but I cannot use that on my custom page, as it only returns
So basically: How do I set appropriate/associate post type to a custom menu item.
Here's an image that hopefully describes a little bit better what I'm after.
As it is now, the Custom Item in the submenu is only available when Pages is active since otherwise
$_GET can't fetch
$post_type = esc_attr( $_GET['post_type'] ); $post_type_object = get_post_type_object( $post_type ); $title = $post_type_object->labels->name; $page = add_submenu_page( 'edit.php?post_type=' . $post_type, $title, $title, 'edit_pages', 'order-' . $post_type, 'cmspo_menu_order_page' );
So I need a way to grab the appropriate post type that the custom item should be associated with, in this case it's "page", but there will be custom items under each custom post type that's been registered with the
capability_type "page" rather than "post".