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.

Our next available supporter will start replying to tickets in about 10.07 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Bobby 1 year, 6 months ago.

Assigned support staff: Bobby.

Author Posts
March 16, 2022 at 6:11 pm #10806569



I am trying to: programatically get the list of all languages active ( = 1) using the hook "wpml_active_languages" for which documentation says : "Filters the list of the languages enabled (active) for a site. "

I have three languages, fr (main), english (active) and ar (hidden) and I use

apply_filters( 'wpml_active_languages', NULL, array ('skip_missing' => 0 ) ) ;

Link to a page where the issue can be seen: site is protected behind htpassword, I can provide the credentials

I expected to see: an array with three languages

Instead, I got: an array with two languages (hidden language is missing, though there is content translated in arabic)

Ofc, I can retrieve the list of active languages with a simple query in the database, but :

- the documentation is misleading
- imho this should definitively bee a wpml function
- I don't like to code myself such basic queries as they always might break if something changes in WPML.

March 17, 2022 at 6:42 am #10809181


Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Please review my colleague's answer as it might help you resolve this issue regarding not being able to retrieve the hidden languages with wpml_active_languages

Let me know your results, please.

March 17, 2022 at 8:28 am #10809599



I'd love to, but the link sends me to a 404 (and it happens for many links to this forum that I find in Google).

I had to search this title on Google and could find the Google cached version.

1- it does the trick
2- does not change the fact that the documentation is inaccurate (as "active languages" in my understanding, include hidden languages: we can work with them, and they are set as active in the database)
3- does not change neither the fact that it would be great to have a filter from WPML to get this information, because basically, it's easier to perform one SQL query than to merge two arrays 😀

Have a nice day.

March 17, 2022 at 6:43 pm #10815811


Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Glad to hear that it works and I appreciate your feedback, I will make sure to pass along to the correct team.

Have a great day as well!