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 8 replies, has 2 voices.
Last updated by Bigul 4 years, 10 months ago.
Assisted by: Bigul.
Author | Posts |
---|---|
June 30, 2020 at 1:57 am #6480757 | |
rosaB-2 |
I'm implementing a SSO service, but understandably, it only offers you one return url. Example: Site URL: hidden link |
June 30, 2020 at 9:15 am #6483653 | |
rosaB-2 |
I have an idea of hooking into where the cookie is updated, and using the original value to do the redirect, but I can't seem to get it to work. In the same place I'm getting the language cookie back as 'en', if I add the following: add_action('wpml_language_has_switched', array( $this, 'get_cookie_lang' ), 0, 3 ); and add the function get_cookie_lang() to the class: public function get_cookie_lang($code, $cookie_lang, $original_language) { echo "\$code = $code<br>\$cookie_lang = $cookie_lang<br>\$original_language = $original_language<br>"; } it does not output anything, which leads me to believe the hook hasn't fired by then, but then how has the cookie lang already been changed? |
July 1, 2020 at 4:18 pm #6497413 | |
Bigul WPML Supporter since 01/2013
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Welcome to the WPML support forum. I will do my best to help you to resolve the issue. Please note, WPML cookies are meant to use by WPML only, and using those cookies in other plugins or themes is not recommended. Therefore please let me know more your requirement and its workflow for a better understanding. So I can consult about this with our team for an expert opinion. To help you faster, I've enabled debug information for this support ticket. Please see this link for how to get this information from your site and give it to us: http://wpml.org/faq/provide-debug-information-faster-support/ -- Bigul |
July 2, 2020 at 1:11 pm #6504835 | |
rosaB-2 |
I have found a workaround by using the wpml_before_init hook to grab the original language cookie before wpml resets it. If that is not recommended, please advise, if it should be fine, the thread can be closed. What I'm doing is developing a plugin to integrate a state-run SSO service (Iceland) - which will guarantee the identity of logged-in users. Example: |
July 3, 2020 at 6:18 am #6510659 | |
Bigul WPML Supporter since 01/2013
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Thank you for the feedback. I have shared the details with our second-tier team for the expert opinion and waiting for their feedback now. We will get back to you as early as possible. Please wait. -- Bigul |
July 3, 2020 at 5:05 pm #6516273 | |
Bigul WPML Supporter since 01/2013
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, We would like to know is it possible to sending the language information to SSO and then using language information when the user comes back. For examples like URL parameter or post request. -- Bigul |
July 4, 2020 at 1:01 am #6517123 | |
rosaB-2 |
Nope, checked that. Not possible. Would it be more "kosher" if I set my own cookie instead of using the WPML one? |
July 4, 2020 at 4:45 pm #6521085 | |
Bigul WPML Supporter since 01/2013
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Thank you for the updates. I have forwarded your feedback to our second-tier team. We will get back to you as early as possible. Please wait. -- Bigul |
July 8, 2020 at 8:18 am #6545385 | |
Bigul WPML Supporter since 01/2013
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Our second-tier team shared the following advice on this. Please check and let me know your feedback.
So when the software hits the direct URL WPML loads the language according to URL which is happening. The proper way is to send the language info in request and receive the same in response. Or while sending request stores the language in Database or custom Cookie then use it later. If not possible then continue using the cookie before WPML reset it. -- Bigul |