Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by Bigul 1 week, 1 day ago.

Assisted by: Bigul.

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
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

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
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

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
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

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