Skip to content

Commit

Permalink
Merge pull request #1625 from INN/1623-has_dhildren-notice
Browse files Browse the repository at this point in the history
Fix for #1624 and #1623: Bootstrap_Nav_Walker::start_el() continued
  • Loading branch information
benlk authored Feb 4, 2019
2 parents a299946 + de816a9 commit da020fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This release contains bug fixes for Largo 0.6.

### Fixes

- Fixes PHP notices in class `Bootstrap_Walker_Nav_Menu`. [Pull request #1624](https:/INN/largo/pull/1624) for [issue #1623](https:/INN/largo/issues/1623) as part of [issue #1492](https:/INN/largo/issues/1492).
- Fixes PHP notices in class `Bootstrap_Walker_Nav_Menu`. [Pull request #1624](https:/INN/largo/pull/1624) and [#1625](https:/INN/largo/pull/1625) for [issue #1623](https:/INN/largo/issues/1623) as part of [issue #1492](https:/INN/largo/issues/1492).
- Fixes a regression in the behavior of the Largo Follow widget. [Pull request #1600](https:/INN/largo/pull/1600) for [issue #1599](https:/INN/largo/issues/1599).
- Fixes issue where post excerpt and featured media were not being used for open graph tags on post types that are `is_singular()` but not `is_single()`. [Pull request #1604)(https:/INN/largo/pull/1604) for [issue #1602](https:/INN/largo/issues/1602).
- Removes duplicate site title in opengraph tags for non-archive, non-`is_front_page()`, non-`is_singular()` URLs. [Pull request #1604](https:/INN/largo/pull/1604) for [issue #1602](https:/INN/largo/issues/1602).
Expand Down
16 changes: 7 additions & 9 deletions inc/nav-menus.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* Output a donate button from theme options
* used by default in the global nav area
Expand Down Expand Up @@ -77,14 +76,13 @@ public function start_lvl( &$output, $depth = 0, $args = array() ) {
}

public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {

$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';

$li_attributes = '';
$class_names = $value = '';

$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = ( isset( $args['has_children'] ) && $args['has_children'] ) ? 'dropdown' : '';
$classes[] = ( isset( $args->has_children ) && $args->has_children ) ? 'dropdown' : '';
$classes[] = ($item->current || $item->current_item_ancestor) ? 'active' : '';
$classes[] = 'menu-item-' . $item->ID;

Expand All @@ -100,14 +98,14 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$attributes .= (( $args['has_children'] ) && ($depth == 0)) ? ' class="dropdown-toggle"' : '';
$attributes .= (( $args->has_children ) && ($depth == 0)) ? ' class="dropdown-toggle"' : '';

$item_output = $args['before'];
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args['link_before'] . apply_filters( 'the_title', $item->title, $item->ID ) . $args['link_after'];
$item_output .= ( ( $args['has_children'] ) && ($depth == 0)) ? ' <b class="caret"></b></a>' : '';
$item_output .= ( ( $args['has_children'] ) && ($depth != 0)) ? ' <i class="icon-arrow-right"></i></a>' : '</a>';
$item_output .= $args['after'];
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= ( ( $args->has_children ) && ($depth == 0)) ? ' <b class="caret"></b></a>' : '';
$item_output .= ( ( $args->has_children ) && ($depth != 0)) ? ' <i class="icon-arrow-right"></i></a>' : '</a>';
$item_output .= $args->after;

$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
Expand Down

0 comments on commit da020fe

Please sign in to comment.