Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are trying to build a custom PHP language switcher for your site using WPML but are unable to find the example code or documentation previously available.
Solution:
We recommend ensuring that you are using the latest version of the WPML plugins, specifically version 4.8.1, which includes the latest bug fixes and improvements that might address your issue. You can check and download the latest versions from My Account -> Downloads on the WPML site. If updates are not visible, you may need to click the 'Check for updates' button in the Plugins → Add New Plugin → Commercial tab. Always remember to back up your database before updating.

If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 5 replies, has 0 voices.

Last updated by Andrey 5 days, 18 hours ago.

Assisted by: Andrey.

Author Posts
May 27, 2025 at 2:03 pm #17079138

Kristof

Background of the issue:
I am trying to build a custom PHP language switcher for my site hidden link using WPML. There used to be a possibility or at least some example code to create a custom language switcher where I could define the query, the li, and a tags.

Symptoms:
I am unable to find the example code or documentation to create a custom PHP language switcher.

Questions:
How can I build a custom PHP language switcher for WPML?
Where can I find example code or documentation for creating a custom language switcher in WPML?

May 28, 2025 at 8:31 pm #17085425

Bigul

Hello,

I have consulted with our team regarding this. By default, the title tag will only appear if it is part of the menu language switcher and if the native language or display name is set. So the current behaviour is expected.

The tricky part is identifying exactly where this is applied and whether it is limited to menu items. Could you please clarify why you're expecting it to appear in the footer language switcher? This information will help us confirm the use case and escalate the issue to our developers for further investigation. Thank you for your kind understanding.

--
Thanks!

Bigul

June 2, 2025 at 10:07 am #17097424

Kristof

To be honest, I don't care where the language switcher is placed, header, footer, menu, sidebar, ... it just needs to display a title attribute on the link. Especially when the language switcher only displays the language flag. It's just required for WCAG and general usability. A link needs a title or an aria-label attribute. It's just common sense.

Why would you only add a title tag when it is displayed in the menu? What's the reason behind that? Why would you make the language switcher less accessible when it's placed anywhere else?

June 3, 2025 at 11:50 am #17102088

Bigul

Hello,

Thank you for the feedback. The ticket is escalated to our second-tier team for further checking. We will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

June 11, 2025 at 7:37 am #17124316

Bigul

Hello,

The ticket has been escalated to our developers for further investigation. A fix will be included in the future version of WPML. We will update you as soon as we receive any feedback from the development team. Thank you for your patience.

--
Thanks!

Bigul

September 18, 2025 at 7:04 pm #17414615

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Just a follow-up on this issue: it should be addressed in the latest release of WPML plugins.

Make sure that you are using the latest version, 4.8.1, and add-ons to benefit from the latest bug fixes and improvements.

You can check the latest released versions under "My Account -> Downloads" on this site.

If you do not see the updates, you might need to click the Check for updates button in the Plugins → Add New Plugin → Commercial tab.

Please remember to back up your database before you proceed.