[wp-trac] [WordPress Trac] #13913: "wp-has-current-submenu" get assigned incorrectly on admin sidebar menu

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 15 20:27:57 UTC 2010


#13913: "wp-has-current-submenu" get assigned incorrectly on admin sidebar menu
--------------------------+-------------------------------------------------
 Reporter:  benjitastic   |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  3.0       
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 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 following screenshot the "Details" page under "Trucks" is active
 but the "wp-has-current-submenu" class is getting placed on "Cars".

 [[Image(http://i.imgur.com/DQfJy.png)]]

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13913>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list