\n"; } function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { $item_html = ''; parent::start_el($item_html, $item, $depth, $args); if ($item->is_dropdown && ($depth === 0)) { $item_html = str_replace('', ' ', $item_html); } elseif (stristr($item_html, 'li class="divider')) { $item_html = preg_replace('/]*>.*?<\/a>/iU', '', $item_html); } elseif (stristr($item_html, 'li class="nav-header')) { $item_html = preg_replace('/]*>(.*)<\/a>/iU', '$1', $item_html); } $output .= $item_html; } function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) { $element->is_dropdown = !empty($children_elements[$element->ID]); if ($element->is_dropdown) { if ($depth === 0) { $element->classes[] = 'dropdown'; } elseif ($depth > 0) { $element->classes[] = 'dropdown-submenu'; } } parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); } }