db_fields['id']; if ( is_object( $args[0] ) ) { $args[0]->has_children = ! empty( $children_elements[$element->$id_field] ); } return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); } /** * Start the element output. * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. May be used for padding. * @param array $args Additional strings. * @return void */ function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $classes = empty ( $item->classes ) ? array () : (array) $item->classes; $class_names = join( ' ' , apply_filters( 'nav_menu_css_class' , array_filter( $classes ), $item ) ); $dropdown_anchor_calss = ''; $dropdown_li_class = ''; if($args->has_children) { $dropdown_li_class = "dropdown"; $dropdown_anchor_calss = "dropdown-toggle"; } ! empty ( $class_names ) and $class_names = ' class="nav-item '. esc_attr( $class_names.' '.$dropdown_li_class ) . '"'; $output .= "