Resolved by author
Overview of the issue
If you are using the Nav Menu widget from Royal Elementor Addons plugin, you will encounter that it renders WPML language switcher in raw HTML on the frontend.
Workaround
Please, make sure of having a full site backup of your site before proceeding.
- Open …/wp-content/plugins/royal-elementor-addons/modules/nav-menu/widgets/wpr-nav-menu.php file.
- Look for line 1656.
- Replace:
1
$output
=
'<a href="'
. esc_url(
$item
->url) .
'" class="'
. esc_attr(
$item_class
) .
'">'
. esc_html(
$item
->title);
- With:
1
$output
=
'<a href="'
. esc_url(
$item
->url) .
'" class="'
. esc_attr(
$item_class
) .
'">'
. wp_kses(
$item
->title,
array
(
'span'
=>
array
() ));