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 ..
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.