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.

This topic contains 1 reply, has 2 voices.

Last updated by Ahmed Mohammed 1 year, 9 months ago.

Author Posts
April 6, 2023 at 9:30 am #13418211

Thomas Henninger

Hello,

We try to get the current langauge of our customers in the shop and want to send this information to sendinblue (3rd party).

But it seems, that sometimes wpml_current_language gives the correct information and sometimes it is just empty and it seems to function if the user is allready registered, but if the user does not have an account allready it just gives nothing ..

What we need is a reliable function that returns (php) the selected langauge even if there is no user logged in / registered ..

Can you help with this?

Thanks

April 6, 2023 at 7:11 pm #13422497

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi Thomas,

Thank you for contacting WPML support!

Regarding your concern, please be advised that the wpml_current_language works the same way for both logged-in and logged-out users. However, the issue you're experiencing might be caused by the custom code you're using. Unfortunately, we are not able to provide support with custom code due to our support policy.

To better understand the issue, I have set up a sandbox website on our servers at hidden link. Please try to replicate the problem on this website so that we can investigate and find out whether something is wrong with the filter.

Looking forward to hearing back from you.

The topic ‘[Closed] wpml_current_language Function works sometimes and sometimes not’ is closed to new replies.