You have this problem, because of your code 😉
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$ident = str_repeat( "\t", $depth );
if ( $args->walker->has_children ) {
$classes="menu-item-has-children menu-item menu-item-" . $item->ID;
// actual link
// you SHOULDN'T close the li tag in here
$output .= "$ident<li class=\"$classes\"><a href=\"$item->url\">$item->title</a></li>\n";
// added tag after
$output .= "<a class=\"added\" href=\"#\">txt</a>";
} else {
$classes="menu-item menu-item-" . $item->ID;
// actual link
// you SHOULDN'T close the li tag in here
$output .= "$ident<li class=\"$classes\"><a href=\"$item->url\">$item->title</a></li>\n";
}
}
In your start_el
you close the li
tag, so children can’t be printed inside of it…