function add_logged_in_user_to_menu($items, $args) {
    if ( is_user_logged_in() && $args->theme_location == 'primary' ) {
        $current_user = wp_get_current_user();
        $user_name = $current_user->first_name . ' ' . $current_user->last_name;
        $items .= '<li id="menu-item-9998" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9999">
            <div class="wrap">
                <a href="https://divertiamo.ch/dashboard/">' . esc_html( $user_name ) . '</a>
            </div>
        </li>';
    }
    return $items;
}
add_filter( 'wp_nav_menu_items', 'add_logged_in_user_to_menu', 10, 2 );