Skip to content

Commit

Permalink
Merge pull request #4 from asifpix/main
Browse files Browse the repository at this point in the history
Class duplicate validation error fix
  • Loading branch information
AlexWebLab committed May 6, 2021
2 parents 17a7eaf + 7ab1552 commit 938969c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions.php
Expand Up @@ -63,10 +63,11 @@ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
$attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';

$active_class = ($item->current || $item->current_item_ancestor) ? 'active' : '';
$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 . '"';
$nav_link_class = ( $depth > 0 ) ? 'dropdown-item ' : 'nav-link ';
$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 . '"';

$item_output = $args->before;
$item_output .= ($depth > 0) ? '<a class="dropdown-item"' . $attributes . '>' : '<a' . $attributes . '>';
$item_output .= '<a' . $attributes . '>';
$item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
$item_output .= '</a>';
$item_output .= $args->after;
Expand Down

0 comments on commit 938969c

Please sign in to comment.