[wp-trac] [WordPress Trac] #17077: Page parent li elements in nav menus not always given current-page-parent class

WordPress Trac noreply at wordpress.org
Mon Oct 7 16:02:25 UTC 2013


#17077: Page parent li elements in nav menus not always given current-page-parent
class
--------------------------+------------------------------
 Reporter:  andymacb      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.1
 Severity:  trivial       |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by ruud@…):

 Hi, I tested the patch in version WordPress 3.7-beta1-25639-src, here are
 my results:

 (only showing relevant classes)

 parent page of selected child page:
 before patch: current-menu-ancestor current-menu-parent
 current_page_parent current_page_ancestor
 after patch:  current-menu-ancestor current-menu-parent
 current_page_parent current-page-parent

 parent page of selected child page after making it is actual parent page
 (in hierarchy):
 before patch: current-menu-ancestor current-menu-parent
 current_page_parent current_page_ancestor current-page-ancestor
 after patch:  current-menu-ancestor current-menu-parent
 current_page_parent current_page_ancestor current-page-ancestor current-
 page-parent

 parent page of selected child page after making it is actual parent page
 (in hierarchy sense) and after re-saving menu:
 before patch: current-menu-ancestor current-menu-parent
 current_page_parent current_page_ancestor current-page-ancestor current-
 page-parent
 after patch:  current-menu-ancestor current-menu-parent
 current_page_parent current_page_ancestor current-page-ancestor current-
 page-parent

 As far as I can see this patch fixes the problem that the menu had to get
 saved again to add the 'current-page-parent' class.

 However 2 more things are not right in my opinion for the situation where
 the parent page when their only relation is in the menu:
 1) having the 'current-page-parent' class in the li for a page which is
 acually no parent of any other page seems not appropriate
 2) the code in the patch doesn't look for further ancestry.

 Thanks!

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


More information about the wp-trac mailing list