sage
sage copied to clipboard
items_wrap being overwritten on wp_nav_menu
If you create a wp_nav_menu eg:
<?php wp_nav_menu(array('menu' => 'Primary Navigation', 'depth' => 0 , 'items_wrap' => '<ul class="primaryNav sf-menu">%3$s</ul>')); ?>
The items_wrap is being completely ignored because it is overwritten in line 592 of cleanup.php.
I believe this can be sorted by only changing the default arguments created by wp_nav_menu to the Roots friendly versions. Placing them within an if statement will mean that customised containers or wraps will not be overwritten.
if ($args['container'] == 'div') {
$roots_nav_menu_args['container'] = false;
}
if ($args['items_wrap'] == '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>') {
$roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
}
The alternative would be to add to the array and check for that but I think the above makes more sense.
this was just fixed by abcfc5200a499572ae4887598c6dd13652ffdfc4 thanks to @sanchothefat