From cf4d843cdeef6e368ae143af42c005e46d80806a Mon Sep 17 00:00:00 2001 From: Stefan Grassberger Date: Fri, 23 Nov 2018 17:25:38 +0100 Subject: [PATCH] Fix dropdown when setting depth=0 in wp_nav_menu --- inc/class-wp-bootstrap-navwalker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-wp-bootstrap-navwalker.php b/inc/class-wp-bootstrap-navwalker.php index a343fcc..5dd2331 100644 --- a/inc/class-wp-bootstrap-navwalker.php +++ b/inc/class-wp-bootstrap-navwalker.php @@ -185,7 +185,7 @@ if ( ! class_exists( 'Understrap_WP_Bootstrap_Navwalker' ) ) { $atts['target'] = ! empty( $item->target ) ? $item->target : ''; $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; // If item has_children add atts to . - if ( isset( $args->has_children ) && $args->has_children && 0 === $depth && $args->depth > 1 ) { + if ( isset( $args->has_children ) && $args->has_children && 0 === $depth && $args->depth !== 1 ) { $atts['href'] = '#'; $atts['data-toggle'] = 'dropdown'; $atts['aria-haspopup'] = 'true';