Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Navbar items break if the menu depth is set to exclude children #707

Merged
merged 1 commit into from Mar 10, 2013

Conversation

Projects
None yet
3 participants
Contributor

kara-todd commented Mar 8, 2013

Navbar items with children broke if the menu depth excluded the children.
Such as: wp_nav_menu(array('depth' => 1)); where 2nd level children exist

Fix for navbar dropdowns
Navbar items with children broke if the menu depth excluded the children.
Such as: wp_nav_menu(array('depth' => 1)) where 2nd level children exist
Owner

retlehs commented Mar 10, 2013

trying to create the issue on my dev environment - i set the wp_nav_menu depth to 1 and have a menu that has several items with children + more children, but can't see any issue occurring

could you show me how to reproduce the problem?

Member

Foxaii commented Mar 10, 2013

This is a good spot.

With depth set less than three, the nav will still be there but you get all the drop down menu markup (classes and carets) even when the children are being excluded and there's nothing to drop down to. This means you would have to lose the menu hierarchy if you only wanted only top level links.

If the logic seems off, $depth + 1 is to account for Roots treating walker depth as zero-based, whereas WordPress treats 1 as the index.

retlehs added a commit that referenced this pull request Mar 10, 2013

Merge pull request #707 from kara-todd/master
Navbar items break if the menu depth is set to exclude children

@retlehs retlehs merged commit c3e7861 into roots:master Mar 10, 2013

Owner

retlehs commented Mar 10, 2013

ahhh. thx @kara-todd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment