1
vote
1answer
182 views

Run a filter when a walker runs

Is there any way to run a particular add_filter function whenever a specific Walker_Nav_Menu class runs? The function always needs to run when the walker goes, and I'd like them to share variables, in ...
1
vote
0answers
263 views

Walker_Nav_Menu doesn't work in wp_page_menu_args filter

I need to hide certain nav items from the menu (based on the password protection functionality) and I'm having trouble getting my custom Walker to work. In fact, I can't even get the standard ...
0
votes
1answer
229 views

Does the 'nav_menu_css_class' filter accept 2 or 3 arguments?

I've been using the nav_menu_css_class filter in one of my plugins, implemented as: add_filter( 'nav_menu_css_class', 'wbwcrf_nav_menu_css_class', 10, 3 ); function wbwcrf_nav_menu_css_class( ...
1
vote
2answers
461 views

wp_list_pages() but only show children on the branch you are on

Lets say I have this menu: Top |___ Sub 1 |___ Sub Sub 1 |___ Sub Sub 2 |___ Sub Sub 3 |___ Sub Sub 4 |___ Sub 2 ...
0
votes
1answer
510 views

How can I apply filters in my class that extends Walker_Nav_Menu?

I have the following piece of abridged code: <?php class New_Walker_Nav_Menu extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { $attributes = ! empty( ...