WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months 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:

Description

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)

comment:1 haveboard3 years ago

  • Cc haveboard added
  • Version changed from 3.0.4 to 3.0.5

comment:2 filosofo3 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.

comment:3 retlehs15 months ago

  • Cc retlehs added

comment:4 meloniq14 months ago

  • Cc meloniq@… added

comment:5 jazbek9 months ago

  • Cc j.yzbek@… added

comment:6 nacin8 months ago

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