Skip to content

Commit 938969c

Browse files
authored
Merge pull request #4 from asifpix/main
Class duplicate validation error fix
2 parents 17a7eaf + 7ab1552 commit 938969c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

functions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
6363
$attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';
6464

6565
$active_class = ($item->current || $item->current_item_ancestor) ? 'active' : '';
66-
$attributes .= ($args->walker->has_children) ? ' class="nav-link ' . $active_class . ' dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"' : ' class="nav-link ' . $active_class . '"';
66+
$nav_link_class = ( $depth > 0 ) ? 'dropdown-item ' : 'nav-link ';
67+
$attributes .= ( $args->walker->has_children ) ? ' class="'. $nav_link_class . $active_class . ' dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"' : ' class="'. $nav_link_class . $active_class . '"';
6768

6869
$item_output = $args->before;
69-
$item_output .= ($depth > 0) ? '<a class="dropdown-item"' . $attributes . '>' : '<a' . $attributes . '>';
70+
$item_output .= '<a' . $attributes . '>';
7071
$item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
7172
$item_output .= '</a>';
7273
$item_output .= $args->after;

0 commit comments

Comments
 (0)