Not aware of post_type so "wp-has-current-submenu" get assigned incorrectly
|Reported by:||benjitastic||Owned by:|
Using: WP 3.0 RC3
I am creating a plugin and adding 2 submenu pages to appear under two custom content types ('Cars' and 'Trucks'). The issue is that Wordpress assigns the "wp-has-current-submenu' to the first "edit.php" admin sidebar nav item even when another is selected.
add_submenu_page('edit.php?post_type=cars', "Details", "Details", $minlevel, __FILE__, 'main_details'); add_submenu_page('edit.php?post_type=trucks', "Details", "Details", $minlevel, __FILE__, 'main_details');
So when I click "Details" under "Trucks" the post_type "Cars" menu item still receives the "wp-has-current-submenu" CSS class.
It looks like the menu needs to be aware of &post_type when assigning the current "wp-has-current-submenu" class instead of just placing it on the first edit.php?post_type.
In the attached screenshot the "Details" page under "Trucks" is active but the "wp-has-current-submenu" class is getting placed on "Cars".