Hi there,
Try this function:
add_filter( 'nav_menu_item_title', function( $title, $item, $args, $depth ) {
$role = 'presentation';
$tabindex = '';
if ( 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
$role = 'button';
$tabindex = ' tabindex="0"';
}
if ( isset( $args->container_class ) && 'main-nav' === $args->container_class ) {
foreach ( $item->classes as $value ) {
if ( 'menu_item_wpglobus_menu_switch' === $value ) {
$icon = generate_get_svg_icon( 'arrow' );
$title = $title . '<span role="' . $role . '" class="dropdown-menu-toggle"' . $tabindex . '>' . $icon . '</span>';
}
}
}
return $title;
}, 10, 4 );
Let me know 馃檪