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?
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.
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?
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.
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.