Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#13409 closed defect (bug) (fixed)

wp_nav_menu current-menu-item incorrect

Reported by: jolley_small's profile jolley_small Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: has-patch needs-testing
Focuses: Cc:

Description

When a page ID is the same as a category ID, and both the page and category are placed in a menu, both items will be given current-menu-item which is incorrect.

Issue exists in beta 1/2.

Attachments (1)

13409.diff (734 bytes) - added by duck_ 15 years ago.

Download all attachments as: .zip

Change History (5)

@duck_
15 years ago

#1 follow-up: @duck_
15 years ago

  • Keywords has-patch needs-testing added

Couldn't find a function to help make this nicer, maybe someone else knows of one... anyway gives the idea of the fix.

#2 @nacin
15 years ago

We could probably just do ( $item->type == 'post_type' && $wp_query->is_singular ) || $item->type == 'taxonomy' && ! $wp_query->is_singular ). Haven't looked at the code yet but if we need to use $wp_query then that'd be easiest and should be good.

#3 in reply to: ↑ 1 @banago
15 years ago

Replying to duck_:

Couldn't find a function to help make this nicer, maybe someone else knows of one... anyway gives the idea of the fix.

It's pretty nice already - Let's hope it will be committed to 3.0.

#4 @nacin
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14824]) Proper checks for current-menu-item. props duck_, fixes #13409.

Note: See TracTickets for help on using tickets.