Skip to content Skip to sidebar

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 1 reply, has 0 voices.

Last updated by Dražen 2 days, 4 hours ago.

Author Posts
July 18, 2025 at 7:51 am #17248878

nielsS-9

Background of the issue:
I am developing a site that uses a custom post type which I do not want to mark as translatable due to performance reasons and other effects. I use the filter hook wpml_active_languages on every page to input a custom language switch.

Symptoms:
On the singular page of the custom post type, the wpml_active_languages filter returns an empty array, preventing the display of the language switch. However, the singular page displays in the correct language when linked from a normal page.

Questions:
Why does the wpml_active_languages filter return an empty array on the singular page of the custom post type?
Is there a workaround to get the same data for display of the language switch on the singular page of the custom post type?

July 18, 2025 at 8:42 am #17249057

Dražen
Supporter

Languages: English (English )

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

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

I am not sure if I understood it correctly, but if you are using it on post type that you have set as Not Translatable, then that is expected, as those posts do not have any language information. Only when set as translatable you would have language information for that post type, default language or translation.

Hope this helps.

Regards,
Drazen