Hi Support
I'm having issues with an invoicing plugin and want to be able to give users the possibility to set their WordPress administration user language, without having access to the WordPress admin. Is this possible with Toolset?
According to
https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/
there is a difference between a user's WordPress admin language and the language which the user is using to view the site via the WPML language switcher.
For example, is it possible to set their preferred language via the front end, either:
(a) on the user registration form when they first create their profile (Toolset User Form)?
(b) elsewhere via the front end, eg on some profile page or similar?
Thanks and kind regards
Simon
Is there any documentation that you are following?
I wasn't able to find any relevant articles in Toolset support forum and only the one article as above on the WPML forum, but it specified allowing the user to access the WordPress backend, which we would like to disallow.
Kind regards
Simon
Hi Simon,
Thank you for contacting us and I'd be happy to assist.
There is no built-in method available in the Toolset Forms for this, so it will require some workaround and custom code.
WordPress store's the language code for the user's selected WordPress admin language as a value, in the user meta field with key 'locale'.
In your user registration or profile edit form, you can include a generic field, with all the language options and then use the 'cred_save_data' hook to programmatically assign that selected language value into the user's 'locale' meta field:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
I hope this helps and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar
Hello Waqar
Thanks for the info and the suggestion, I'll bear this in mind while looking at solutions and get back to Support if i have any issues using the suggested customisation.
My issue is resolved now. Thank you!