Opened 9 years ago
Last modified 2 weeks ago
#38486 assigned defect (bug)
current_page_parent class wrongly added to menu item
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 4.6.1 |
| Component: | Menus | Keywords: | has-patch needs-unit-tests needs-refresh |
| Focuses: | Cc: |
Description
If the current page being viewed is either of the following:
- a custom post type archive
- a custom post type single item
a current_page_parent class is added to the menu item assigned as the page_for_posts.
I believe this is wrong because the page assigned as the page_for_posts is associated with posts only. It has nothing to do with CPTs.
Attachments (2)
Change History (11)
#3
@
9 years ago
- Keywords has-patch added; needs-patch removed
@welcher sure!
Attached is 38486.diff, which will ensure the current_page_parent class doesn't get added to the static home page link if the query is for a custom post type single item or archive.
#4
@
8 years ago
I have the same issue. The patch from @henry.wright fixes that the current_page_parent class is added incorrectly to the blog page menu item when viewing a CPT archive or single view. My patch 38486.2.diff goes further and adds the current_page_parent class to the post type archive menu item if a single view of this CPT is displayed.
@welcher and/or @westonruter – could you take a look at the patch? Would be great to get a fix for that into core :)
#6
@
7 years ago
When will this be added into core? the issue is still a big problem, in 5.1.1, I'm right now trying to work a fix via CSS, but it's just not working well (I have two highlighted menu items, the CPT archive menu item, and the Blog item).
#7
@
7 years ago
- Keywords needs-unit-tests needs-testing added
- Owner set to williampatton
- Status changed from new to assigned
I'll pick this one up and try shepherd it through testing and onto a Future Release milestone.
#9
@
2 weeks ago
- Keywords needs-refresh added; needs-testing removed
The attached patch does not apply cleanly on current trunk (patch rejects occur), so it cannot be properly tested right now. Because of this, removing needs-testing and adding needs-refresh.
Once the patch is refreshed and applies cleanly, we can proceed with testing.
Thanks for the ticket! Would you like to create a patch?