Opened 11 years ago
Closed 9 years ago
#25200 closed enhancement (wontfix)
Cannot filter Walker items in Walker_Nav_Menu_Checklist class
Reported by: | maxaud | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.6 |
Component: | Menus | Keywords: | needs-patch |
Focuses: | administration | Cc: |
Description
I have a need to filter the URL of a menu item in the nav-menus.php admin page.
The Walker_Nav_Menu class uses the following code to filter the attributes which would be great but..
$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
.. the Walker_Nav_Menu_Checklist class that generates a checklist doesn't filter the links attributes like the Walker_Nav_Menu class.
Change History (3)
#1
@
11 years ago
- Focuses administration added
- Keywords reporter-feedback added
- Type changed from defect (bug) to enhancement
#2
@
11 years ago
- Keywords reporter-feedback removed
I needed to modify the URL associated with the checklist item.
Here is some coded generated by the item (see: "[menu-item-url]"):
<li> <label class="menu-item-title"><input type="checkbox" class="menu-item-checkbox" name="menu-item[-2][menu-item-object-id]" value="15706">Some Page Item</label> <input type="hidden" class="menu-item-db-id" name="menu-item[-2][menu-item-db-id]" value="0"> <input type="hidden" class="menu-item-object" name="menu-item[-2][menu-item-object]" value="page"> <input type="hidden" class="menu-item-parent-id" name="menu-item[-2][menu-item-parent-id]" value="0"> <input type="hidden" class="menu-item-type" name="menu-item[-2][menu-item-type]" value="post_type"> <input type="hidden" class="menu-item-title" name="menu-item[-2][menu-item-title]" value="Some Page Item"> <input type="hidden" class="menu-item-url" name="menu-item[-2][menu-item-url]" value="http://domain.com/some-wordpress-url/"> <input type="hidden" class="menu-item-target" name="menu-item[-2][menu-item-target]" value=""> <input type="hidden" class="menu-item-attr_title" name="menu-item[-2][menu-item-attr_title]" value=""> <input type="hidden" class="menu-item-classes" name="menu-item[-2][menu-item-classes]" value=""> <input type="hidden" class="menu-item-xfn" name="menu-item[-2][menu-item-xfn]" value=""> </li>
#3
@
9 years ago
- Keywords needs-patch added
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Closing as wontfix. Complete lack of interest on the feature on the ticket over the last 2 years. Feel free to reopen when more interest re-emerges (particularly if there's a patch)
Note: See
TracTickets for help on using
tickets.
@maxaud, can you provide more detail on what you're trying to do?
Walker_Nav_Menu_Checklist generates the checklists within the accordion sections in nav-menus.php (Pages, Links, Categories etc.). It does not generate a link for each nav item. I think you might be confusing one class with another.