#36800 closed enhancement (wontfix)
Add object ID to menu item class name
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Menus | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
When i create custom menu, and i.e. there is included a category/page in the menu (as you already add word "category" or "page" in the class name), please, add the ID of that category/page too... that will be a much help.
or give us a possibility at least, if i define constant (in my functions.php) SHOW_ID_IN_CUSTOM_MENUS to true, then in this case. (or include slug name too.. will be good)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hey there,
If you want to add specific classes to menu items, you can use the
nav_menu_css_classfilter for that. Check out the documentation for this hook: https://developer.wordpress.org/reference/hooks/nav_menu_css_class/So there's already a way to do that. We do not add constants for this. Instead, WordPress has a powerful hooks/filters system.