\n"; } public function end_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat("\t", $depth); $output .= "$indent\n"; } public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $has_children = in_array('menu-item-has-children', $item->classes); // Top-level item with children -> use
if ($depth === 0 && $has_children) { $output .= ''; } else { $output .= ''; } } }