Skip to content Skip to sidebar

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

Problem:
The client wants to reopen a thread related to TWIG on the WPML support forum but did not specify any particular issue or error message.
Solution:
We reviewed the client's theme code and confirmed that they are using Timber with an integration. The integration is handled via PHP, ensuring that the language switcher and other multilingual functionalities are correctly implemented without needing changes. The TWIG code within the template remains unaffected by our updates unless used inside shortcodes, which is not the case here. 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 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.

This topic contains 4 replies, has 0 voices.

Last updated by tomaszH-11 1 month, 2 weeks ago.

Assisted by: Marcel.

Author Posts
June 13, 2025 at 10:49 am #17132916

tomaszH-11

Background of the issue:
I want to reopen a thread related to TWIG on the WPML support forum. The thread is located at https://wpml.org/forums/topic/twig/. I am following some documentation.

Symptoms:
No specific issue or error message mentioned.

Questions:
How can I reopen the thread at https://wpml.org/forums/topic/twig/?

June 16, 2025 at 10:43 am #17138195

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

we can continue the conversation here. Here’s the last message I sent:

To assist you further, I’d like to request FTP access. This would help me better understand how your theme is working and allow me to review the Twig implementation directly. If possible, we’d look into temporarily commenting out the relevant code to prevent errors from the deprecation, and evaluate whether switching to a standard menu-based solution could work—ideally without requiring a custom PHP switcher. This really depends on how the current switcher is styled and implemented, which I can't assess without seeing the actual output.

I've enabled a private message so you can securely share the credentials.

Best regards,
Marcel

June 16, 2025 at 4:12 pm #17139895

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Thanks! I'm currently downloading your theme via FTP so I can search through all the Twig files locally and better understand where each part is coming from. I’ll keep you posted.

Best regards,
Marcel

June 17, 2025 at 3:27 pm #17143149

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

I forward your case to our developers. I will keep you updated once I receive feedback.

Best Regards,
Marcel

June 19, 2025 at 12:03 pm #17150528

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi there,

thanks for your patience. We checked your theme code and in your case, you are using timber with an integration such as:

add_filter('timber/context', function ($context) {
    $context['menu'] = \Timber\Timber::get_menu('primary');
    $context['mega_menu'] = \Timber\Timber::get_menu('megamenu');
    $context['footer'] = \Timber\Timber::get_menu('footer');
    $context['secondary_footer'] = \Timber\Timber::get_menu('secondary_footer');

    $context['options'] = get_fields('options');
    $context['abs_path'] = __DIR__;
    $context['cookies'] = $_COOKIE;
    $context['global_pagination_mid_size'] = 3;
    $context['is_mobile'] = wp_is_mobile();
    $context['languages'] = apply_filters('wpml_active_languages', NULL);
    $context['current_language'] = apply_filters('wpml_current_language', NULL);
    $context['is_within_hours'] = is_within_hours($context['options']['open_hour'], $context['options']['close_hour']);
    $context['is_today_weekend'] = is_today_weekend();
    $context['shop_url'] = get_permalink(wc_get_page_id('shop'));
    $context['global_per_page'] = 24;
    $context['equipment_with_hotspots_id'] = 'equipment-with-hotspots';
    $context['instructions_id'] = 'instructions';
    $context['dimensions_id'] = 'dimensions';

    return $context;
});

That means the switcher integration is handled via PHP, so no changes are needed. Twig code within your template is not affected by our update — unless you’ve used our Twig template inside short codes, which is not the case based on the code above.

Best Regards,
Marcel

June 20, 2025 at 10:04 am #17153691

tomaszH-11

Thank you, let's hope this is the case 🙂