• Resolved makmerghen

    (@makmerghen)


    Hello
    is that possible
    I need to add language selector tab in account page so user can go there and select his default language that will work every time he log in the website

    please let me know how to do that
    best regards

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    1. When you add the choices callback, it will automatically add the choices in the options. Leave it as is and then save the field. Add the default value in the field settings if you must have it.

    2. What happens when you add Arabic instead of ar? Does it select the default value when you edit the profile?

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    Dear @champsupertramp
    I added Arabic instead of ar and I got same result no default value

    best regards

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    If a profile is already saved, it won’t have a default value. Have you tried creating a new profile and then checking the profile if it has a default value after the registration?

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    Dear @champsupertramp
    I did Arabic as default language in form setting
    and
    I created user without choose any language the result that the user was created without choose any language in wp edit user page
    but when I select Arabic in UM register form the created user got Arabic language

    best regards

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    The default value for UM Profile/Register form only works within the UM. If you’re registering a user via WP Admin > Users, it won’t set any locale. You can try the following code snippet to add a default locale value for the registered user.

    add_action("user_register","um_011022_add_default_locale");
    function um_011022_add_default_locale( $user_id ){
        update_user_meta( $user_id, "locale", "ar");
    }

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    okay Dear @champsupertramp thank you I will not use the callback since using the normal way give the right result
    thanks very much for helping

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    Thanks for letting us know.

    Regards,

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘add language switcher in account page’ is closed to new replies.