php – Add an element after the title of the navigation element does not work as expected

I'm currently trying to add a vacuum after each element title of my navigation with children. So, only the rolling items. Unfortunately, some of my articles that do not have a drop-down list have inserted after the title. It's so strange. What am I doing wrong?

    add_filter ('nav_menu_item_args', 'nav_menu_modify_dropdown', 10, 3);
function nav_menu_add_dropdown ($ args, $ item, $ depth) {
error_log (print_r ($ item, true));
if ($ args-> theme_location === & # 39; primary-menu && in_array (& # 39; menu-item-has-children & # 39 ;, $ item-> classes, true)) {
$ args-> link_after = & # 39;& # 39 ;;
}

returns $ args;
}