Skip to content

Commit

Permalink
Merge pull request #481 from IanDelMar/undefined-property
Browse files Browse the repository at this point in the history
Fix dropdowns
  • Loading branch information
pattonwebz committed Jul 21, 2020
2 parents bff47bd + 43a2bd0 commit 2604259
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions class-wp-bootstrap-navwalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,17 @@ public function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) {
$output .= $indent . '<li ' . $id . $class_names . '>';

// Initialize array for holding the $atts for the link item.
$atts = array();

$atts = array();
$atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : '';

$atts['target'] = ! empty( $item->target ) ? $item->target : '';

if ( '_blank' === $item->target && empty( $item->xfn ) ) {
$atts['rel'] = 'noopener noreferrer';
} else {
$atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
}

// If the item has_children add atts to <a>.
if ( $args->has_children && 0 === $depth && $args->depth > 1 ) {
if ( $this->has_children && 0 === $depth ) {
$atts['href'] = '#';
$atts['data-toggle'] = 'dropdown';
$atts['aria-haspopup'] = 'true';
Expand Down

0 comments on commit 2604259

Please sign in to comment.