I'm reaching out regarding an issue I'm experiencing with user language registration on my WordPress website. I'm using Elementor Pro forms along with WPML for multilingual support. The goal is to automatically register the user's language based on the language of the page they register from.
Issue:
Despite implementing a solution involving a hidden field in an Elementor form with a shortcode to capture the language, the user's language is not updating correctly in their profile.
Steps Taken:
Implemented a hidden field in the Elementor form with a shortcode [language] to capture the language.
Created a custom function to update the user's language upon form submission, which includes wp_update_user() and do_action('wpml_set_language').
Confirmed through error logging that the language shortcode is capturing the correct language value.
Confirmed that the update_user_language function is being executed upon form submission.
Environment:
WordPress version: [Your WordPress version]
WPML version: [Your WPML version]
Elementor version: [Your Elementor version]
Any other relevant plugins or themes: [List any other plugins or themes that might interact with user registration or language settings]
Expected Outcome:
The user's language should be updated automatically based on the language of the page they register from, using the Elementor form.
Request for Assistance:
I would greatly appreciate your assistance in diagnosing and resolving this issue. If there are any additional steps or troubleshooting methods I can try, please let me know.