The ticket was escalated to me and I moved it to our feature requests list.
The functionality that you request - namely to use a shortcode in a menu item - is something that requires additional coding and we cannot provide that for you.
The official way, supported by WPML, to add a language switcher in a menu is to use the page WPML > Languages > Menu language switcher > Add a new language switcher to a menu button.
The fact that you are overriding WordPress to execute shortcodes in a menu item is - let's say it - not entirely a proper and documented way of doing it, as it was not designed to be done in this way.
Yes, I can see that in the past you have been offered a solution, however, that said solution seems to utilize a 3rd party plugin - “Shortcode in Menus” plugin available for free at: https://wordpress.org/plugins/shortcode-in-menus/, and in manner of fact, if I use that plugin, and if I use their custom element "Shortcode", I can add a language switcher with a shortcode to the menu and you can see my results in hidden link. Of course, you have to manually translate the menu item of the type "shortcode" so that it works properly.
I hope that this helps you resolve the issue that you have.
The topic ‘[Feature Request] Language switcher shortcode does not work in menu’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.