#21369 closed defect (bug) (fixed)
Duplicate current-menu-item classes in Menu when using multiple taxonomy terms with the same slug
Reported by: | jchristopher | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Menus | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
If Taxonomy-based Menu items have the same slug (regardless of Taxonomy name) classes of current-menu-item
, current-menu-ancestor
, etc. will be added to all Taxonomy term Menu items that have the slug of the object currently being viewed. This is not an issue with Page-based Menu items.
Test case: if you have a Category named "Test" with a slug test
and also have a Tag named "Test" with a slug test
and create a Menu using those two terms, viewing either archive page will result in the menu having two items with a class of current-menu-item
which results in unwanted styling. This is not an issue if a Page Menu item has a slug of test
.
Screenshot of Menu setup: http://d.pr/i/WtJg/5vBu91hX
Screenshot of duplicate class issue: http://d.pr/i/M4VH/4nbAdJZY
Attachments (1)
Change History (10)
#3
follow-up:
↓ 4
@
13 years ago
Forgive my ignorance with this process but with a patch submitted will this fix continue to not be in place until 3.5?
#4
in reply to:
↑ 3
;
follow-up:
↓ 5
@
13 years ago
Replying to jchristopher:
Forgive my ignorance with this process but with a patch submitted will this fix continue to not be in place until 3.5?
3.5 is the next major release, so it will be fixed then, yes.
You may be able to use a filter to correct the classes in the meantime.
#5
in reply to:
↑ 4
@
13 years ago
Replying to nacin:
Replying to jchristopher:
Forgive my ignorance with this process but with a patch submitted will this fix continue to not be in place until 3.5?
3.5 is the next major release, so it will be fixed then, yes.
You may be able to use a filter to correct the classes in the meantime.
Great, thanks Nacin! I'll check into that.
Categories and tags with the same name share the same ID (related: #5809).
21369.patch adds a check for the queried object taxonomy.