[wp-trac] [WordPress Trac] #14844: wp_nav_menu producing unexpected results

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 11 09:42:40 UTC 2010


#14844: wp_nav_menu producing unexpected results
--------------------------+-------------------------------------------------
 Reporter:  holypixel     |       Owner:                                
     Type:  defect (bug)  |      Status:  new                           
 Priority:  normal        |   Milestone:  Awaiting Review               
Component:  Menus         |     Version:  3.0.1                         
 Severity:  normal        |    Keywords:  wp_nav_menu, current-menu-item
--------------------------+-------------------------------------------------

Comment(by filosofo):

 Replying to [ticket:14844 holypixel]:
 > Item D, under both parent 1 and parent 2 will have the css class
 current-menu-item. This appears to be incorrect, as they are both differnt
 menu items. It also lists current-page-item for both, which is correct.

 I don't understand why you think that is incorrect.  If I am currently
 viewing the Item D page, then Item D is the current item, no matter what
 list it appears in.  Item D is identical to Item D, so it's not as though
 one Item D appears in a different place in the actual site hierarchy than
 the other.

 And from a practical matter, how is WordPress supposed to know which Item
 D you really intend to be visiting?  Each Item D has the same URL, so
 there's no way to distinguish them.

 Think about it this way. I might categorize the United States under
 multiple lists: say "North American Countries" or "UN Security Council
 Members," but for each list it is still correct to say that the United
 States is the country in which I currently reside.

 > As such, it appears impossible to apply unique styling to the current
 page parent if that page appears under multiple parents, as all of the
 parents will receive the same style.
 >
 > Is there a way around this?

 To me this seems like a conceptual problem, not a technical one.  Instead
 of trying to make two identical objects differ, try making two different
 objects.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14844#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list