includes/cs-bootstrap-register-menu.php
/* Output the <li> and the containing <a>
   * Note: $depth is "correct" at this level
   */
Output the  and the containing 
Note: $depth is "correct" at this level
Output the and the containing Note : $depth is " correct " at this level
function start_el(&$output, $item, $depth, $args)
  {
    global $wp_query;
    $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    $class_names = $value = '';
    $classes = empty( $item->classes ) ? array() : (array) $item->classes;
    if ($item->hasChildren) {
      $classes[] = 'dropdown';
      if($depth == 1) {
        $classes[] = 'dropdown-submenu';
      }
    }
    $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
    $class_names = ' class="' . esc_attr( $class_names ) . '"';
    $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>';
    $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
    $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        ) .'"' : '';
    $item_output = $args->before;
    if ($item->hasChildren && $depth == 0) {
      $item_output .= '<a'. $attributes .' class="dropdown-toggle" data-toggle="dropdown">';
    } else {
      $item_output .= '<a'. $attributes .'>';
    }
    $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
    if ($item->hasChildren && $depth == 0) {
      $item_output .= '<b class="caret"></b></a>';
    } else {
      $item_output .= '</a>';
    }
    $item_output .= $args->after;
    $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
    return;
  }
function start_el ( & $ output , $ item , $ depth , $ args ) { global $ wp_query ; $ indent = ( $ depth ) ? str_repeat ( " \t " , $ depth ) : '' ; $ class_names = $ value = '' ; $ classes = empty ( $ item -> classes ) ? array ( ) : ( array ) $ item -> classes ; if ( $ item -> hasChildren ) { $ classes [ ] = 'dropdown' ; if ( $ depth == 1 ) { $ classes [ ] = 'dropdown-submenu' ; } } $ class_names = join ( ' ' , apply_filters ( 'nav_menu_css_class' , array_filter ( $ classes ) , $ item ) ) ; $ class_names = ' class="' . esc_attr ( $ class_names ) . '"' ; $ output .= $ indent . '<li id="menu-item-' . $ item -> ID . '"' . $ value . $ class_names . '>' ; $ attributes = ! empty ( $ item -> attr_title ) ? ' title="' . esc_attr ( $ item -> attr_title ) . '"' : '' ; $ 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 ) . '"' : '' ; $ item_output = $ args -> before ; if ( $ item -> hasChildren && $ depth == 0 ) { $ item_output .= '<a' . $ attributes . ' class="dropdown-toggle" data-toggle="dropdown">' ; } else { $ item_output .= '<a' . $ attributes . '>' ; } $ item_output .= $ args -> link_before . apply_filters ( 'the_title' , $ item -> title , $ item -> ID ) . $ args -> link_after ; if ( $ item -> hasChildren && $ depth == 0 ) { $ item_output .= '<b class="caret"></b></a>' ; } else { $ item_output .= '</a>' ; } $ item_output .= $ args -> after ; $ output .= apply_filters ( 'walker_nav_menu_start_el' , $ item_output , $ item , $ depth , $ args ) ; return ; }
Output the <li> and the containing <a>
 Note: $depth is "correct" at this level
Output the <li > and the containing <a > Note : $depth is " correct " at this level
/* If this item has a dropdown menu, add the 'dropdown' class for Bootstrap */ // level-1 menus also need the 'dropdown-submenu' class /* This is the stock Wordpress code that builds the <li> with all of its attributes */ /* If this item has a dropdown menu, make clicking on this link toggle it */ /* Output the actual caret for the user to click on to toggle the menu */