You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sb_nav_menu has 2 filters in it: sb_nav_menu_defaults and sb_{$menu_id}_menu.
the second one seems relatively useless because just returns all of the html for the menu.
My main point is to add a filter immediately after the first one, sb_nav_menu_defaults (line 41 in includes/functions/menus.php). Currently, you can filter defaults but there's no way to target a specific menu (which is what I had wanted to do).
All that would be needed is this: $r = apply_filters( "sb_nav_menu_args", $r );
just after the sb_nav_menu_defaults filter and you have access to all of a menu's arguments before they get created by wp_nav_menu. My use for this was adding separators between menu items on just 1 of my 3 menus.
Sidenote, I don't know if it's proper etiquette to just submit a pull request or to ask about it here first. I'd be happy to submit the pull if this is a thumbs up.
The text was updated successfully, but these errors were encountered:
In fact, opening an issue and the immediately following with a PR is totally okay (preferred, even). GitHub makes it super easy to review and discuss specific lines of code, and you can continue to commit code as part of your PR until it is eventually merged or closed. It's a very slick process!
I would call the new filter sb_nav_menu_{$menu_id}_args, I think.
sb_nav_menu has 2 filters in it: sb_nav_menu_defaults and sb_{$menu_id}_menu.
the second one seems relatively useless because just returns all of the html for the menu.
My main point is to add a filter immediately after the first one, sb_nav_menu_defaults (line 41 in includes/functions/menus.php). Currently, you can filter defaults but there's no way to target a specific menu (which is what I had wanted to do).
All that would be needed is this:
$r = apply_filters( "sb_nav_menu_args", $r );
just after the sb_nav_menu_defaults filter and you have access to all of a menu's arguments before they get created by wp_nav_menu. My use for this was adding separators between menu items on just 1 of my 3 menus.
Sidenote, I don't know if it's proper etiquette to just submit a pull request or to ask about it here first. I'd be happy to submit the pull if this is a thumbs up.
The text was updated successfully, but these errors were encountered: