Skip Navigation

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

Problem:
The client needed to determine if their site uses Twig templates for the WPML language switcher, as they received a notification about changes related to Twig. They provided code snippets and details about their implementation, which they did years ago and were unsure about the current setup.
Solution:
We advised the client that the code they shared indicates a PHP-based implementation of the WPML language switcher, not a Twig-based one. Therefore, their current setup should not be affected by the changes related to Twig templates. We recommended that they ensure they have a full website backup as a precaution. Additionally, we confirmed that all links shared in the support ticket are private and only visible to the client and the support team.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, 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.

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.

This topic contains 3 replies, has 0 voices.

Last updated by Mihai Apetrei 3 weeks, 6 days ago.

Assisted by: Mihai Apetrei.

Author Posts
June 14, 2025 at 3:44 am #17134968

charleneR-2

Background of the issue:
I received an email notice from WPML about changing the switcher if it uses twig. I am unsure if my site, hidden link, uses twig templates or just PHP.

Symptoms:
Uncertainty about whether the site uses twig templates for the switcher.

Questions:
How do I determine if my site uses twig templates for the switcher?

June 14, 2025 at 4:44 am #17134974

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there. Thank you for contacting WPML support.

If you added the language switcher through WPML settings, a shortcode, or a widget, there is no need to worry; it will continue to function correctly.

However, if the switcher is implemented directly in your theme's code, you may want to consult the theme author to understand how the WPML language switcher is integrated. Alternatively, if you have the necessary skills, you can check the theme's template files yourself to identify the file responsible for rendering the switcher and verify how it has been integrated. Inspecting with the tool in the browser won’t indicate whether a Twig template has been used.

One important thing you can do is make sure that you have a full website backup for any of your sites, just to be safe in case something breaks. But not many people reported using Twig.

I hope that you will find this information helpful.

Mihai Apetrei

June 14, 2025 at 6:30 am #17135038

charleneR-2

I was the one who implemented the code with the help of a little guidance from your tech support and then a couple of final tweaks from a programmer who helped me finish it. The problem is, I did this years ago. I don't remember anything called Twig and I know that the main categories on the page were hand coded in the header.php file:

<div id="wpmlrow"><div id="insidewpml"><span style="float:right;"><?php do_action('wpml_add_language_selector'); ?></span></div></div>
<div id="headercontainer">
<div id="maincatscontainer" ><div id="mcinside">
<i class="fa fa-fw" aria-hidden="true"> <span class="maincats"><?php apply_filters( 'wpml_element_link', 627, 'page',__('Underwater Lights', 'woothemes')); ?></span> <br/>
<i class="fa fa-fw" aria-hidden="true"> <span class="maincats"><?php apply_filters( 'wpml_element_link', 12547, 'page',__('Underwater Cameras', 'woothemes')); ?></span> <br/>
<i class="fa fa-fw" aria-hidden="true"> <span class="maincats"><?php apply_filters( 'wpml_element_link', 630, 'page',__('Deck Lights','woothemes')); ?></span> <br/>
<i class="fa fa-fw" aria-hidden="true"> <span class="maincats"><?php apply_filters( 'wpml_element_link', 11697, 'page',__('Marine Hardware','woothemes')); ?></span> <br/>
</div>">


</div>

Viewing the source, I see this as well:
<link rel="alternate" hreflang="en" href="hidden link" />
<link rel="alternate" hreflang="it" href="hidden link" />
<link rel="alternate" hreflang="fr" href="hidden link" />
<link rel="alternate" hreflang="es" href="hidden link" />
<link rel="alternate" hreflang="x-default" href="hidden link" />

And these are the flags and languages across the top:
<div id="wpmlrow"><div id="insidewpml"><span style="float:right;">
<div class="wpml-ls-statics-shortcode_actions wpml-ls wpml-ls-legacy-list-horizontal">

</div>

Does this tell you enough to know if there is an issue. Can you also make sure that this ticket with my client's domain in it stays private?

June 14, 2025 at 8:29 pm #17135711

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there and welcome back.

Thank you for sharing the example.

No, the code you shared is not related to a Twig-type switcher. It’s a PHP-based implementation of WPML’s language switcher and element linking, typical of classic WordPress themes or plugins.

So I would say that you are "safe". 🙂

All the links you shared here are automatically hidden from anyone else (only you and I can see them). If you log out and try to load this ticket, you will know you can't see any links.

The only public links in tickets are related to our website and documentation.