Make WordPress Core

Opened 5 years ago

Closed 2 years ago

#16382 closed defect (bug) (wontfix)

Menus adds "current_page_parent" class to the blog page when viewing a custom post type entry

Reported by: tammyhart Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.5
Component: Menus Keywords: dev-feedback close
Focuses: Cc:


Here is an example: http://www.flowermag.com/article/love-rocks/

This entry is in the custom post type "article", but the navigation item "blog" is getting the class "current_page_parent" even though an article is not a blog post.

This is a problem since if you're using "current_page_parent" for navigation highlighting, this would render an incorrect display.

Change History (6)

#1 @haveboard
5 years ago

  • Cc haveboard added
  • Version changed from 3.0.4 to 3.0.5

#2 @filosofo
5 years ago

  • Keywords close added
  • Milestone changed from Awaiting Review to Future Release

current_page_parent is meant to make the menus work in a backwards-compatible way with the classes given to pages in lists, thanks to Walker_Page.

Specifically, Walker_Page, which generates the class names for many page lists, considers everything not a page to be a child of the "posts page." Maybe it shouldn't, but that's the behavior that would need to be changed first.

Instead, you can use the "current-menu-parent" class to specify elements that are parents of the currently-requested page, without this backwards-compatibility quirk.

#3 @retlehs
3 years ago

  • Cc retlehs added

#4 @meloniq
3 years ago

  • Cc meloniq@… added

#5 @jazbek
2 years ago

  • Cc j.yzbek@… added

#6 @nacin
2 years ago

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