Opened 6 years ago
Last modified 2 years ago
#35702 new enhancement
No current-menu-item in WP custom menus
Reported by: | dotancohen | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Menus | Keywords: | needs-refresh |
Focuses: | ui, template | Cc: |
Description
The _wp_menu_item_classes_by_context() method misses some menu item matches for the currently-queried object. This patch adds support for a common case.
Attachments (2)
Change History (5)
#1
@
6 years ago
My test case is for the taxonomy archive "מוצרים", where the custom menu was set "/מוצרים" and "/מוצרים/", both of which are valid links but neither of which was matched by the pre-patch WP trunk. With the patch both cases are matched properly.
#3
@
5 years ago
- Keywords needs-refresh added
@dotancohen - Thanks for the patch!
It just needs some clean up to match coding standards for whitespace. https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#space-usage
After that, let's get some unit tests in place.
Note: See
TracTickets for help on using
tickets.
Diff file which resolves the issue for a common use case.