WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#14560 closed defect (bug) (worksforme)

class 'current-page-parent' is being to the parent page and to the parent page of other menu items

Reported by: juggledad Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Menus Keywords: reporter-feedback
Focuses: Cc:

Description

Description: The class 'current-page-parent' is being assigned twice to the parent page and is being assigned to the parent page of other menu items.

To reproduce

1) use the TwentyTen theme

2) add two categories: CAT-PARENT and CAT-CHILD

3) add two pages: PAGE-PARENT and PAGE-CHILD

4) add a menu, add the two categories and two pages and adjust them so the children are under the parents

5) select the PAGE-CHILD and look at the source

Note that the CAT-PARENT has the class 'current-page-parent'

Note that PAGE-PARENT has the class 'current-page-parent current-page-parent'.

Here is the HTML that is generated.

<ul id="menu-cat_test" class="menu">

<li id="menu-item-1408" class="menu-item menu-item-type-taxonomy current-page-parent menu-item-1408"><a href="http://wp301/?cat=3">CAT-PARENT</a>

<ul class="sub-menu">

<li id="menu-item-1409" class="menu-item menu-item-type-taxonomy menu-item-1409"><a href="http://wp301/?cat=8">CAT-CHILD</a></li>

</ul>

</li>

<li id="menu-item-1413" class="menu-item menu-item-type-post_type current-page-ancestor current-menu-ancestor current-menu-parent current-page-parent current_page_parent current_page_ancestor menu-item-1413"><a href="http:///wp301/?page_id=3">PAGE-PARENT</a>

<ul class="sub-menu">

<li id="menu-item-1411" class="menu-item menu-item-type-post_type current-menu-item page_item page-item-7 current_page_item menu-item-1411"><a href="http://wp301/?page_id=7">PAGE-CHILD</a></li>

</ul>

</li>

</ul>

Change History (5)

comment:1 @juggledad5 years ago

  • Summary changed from class 'current-page-parent' is being assigned twice to the parent page and is being assigned to the parent page of other menu items to class 'current-page-parent' is being to the parent page and to the parent page of other menu items

comment:2 follow-up: @juggledad5 years ago

correction the line
Note that PAGE-PARENT has the class 'current-page-parent current-page-parent'.
should be
Note that PAGE-PARENT has the class 'current-page-parent current_page_parent'.

comment:3 in reply to: ↑ 2 @filosofo4 years ago

  • Keywords reporter-feedback added; current-page-parent removed
  • Milestone changed from Awaiting Review to 3.1

Replying to juggledad:

Note that PAGE-PARENT has the class 'current-page-parent current_page_parent'.

This is intended behavior. current_page_parent is meant to be compatible with the underscore-style classes generated by wp_page_menu.

Regarding the main problem, which is the current-page-parent class being applied to the category parent while the viewed page is the page child: I cannot reproduce this either in WordPress 3.0.1 or the current development version. I even tried making the category and page IDs the same (as they seem to be in your example), but still could not reproduce it.

Are you able to reproduce the error with WordPress trunk?

comment:4 @nacin4 years ago

  • Milestone changed from 3.1 to Awaiting Review

comment:5 @filosofo4 years ago

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