I register a Custom Post Type, and I don\'t want it to have its own menu, instead I want to place it as a submenu of an existing admin menu item called my-custom-parent-pa
can't say, what's exactly the reason, but it seems wordpress redirects to the first submenu-item.
So you have to create a new sub-menu-item with the same contents of your parent-menu-item.
add_action('admin_menu', 'my_admin_menu');
function my_admin_menu() {
global $submenu;
add_menu_page('My Menu', 'My Menu', 'administrator', 'my-menu', 'callback_func');
$parent = array('My Menu', 'administrator', 'my-menu', 'My Menu'); // new submenu-itm
$submenu['my-menu'] = fix_menu($submenu['my-menu'], $parent); // adds the new submenu-item at beginning of 'my-menu'-item
}
function fix_menu($submenu) {
array_unshift ($submenu, $parent);
return $submenu;
}
Hope it works for you.