WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#13913 closed defect (bug) (duplicate)

"wp-has-current-submenu" get assigned incorrectly on admin sidebar menu

Reported by: benjitastic Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: General Keywords:
Focuses: Cc:

Description

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".

http://i.imgur.com/DQfJy.png

Change History (1)

#1 @nacin
10 years ago

  • Milestone Unassigned deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.