I have a settings page that shows the users wordpress role. I am using wp_get_current_user()->roles
get that list. However, that list appears in English, and often my users have their locale set to something other than English.
Is there a way to get the users role in a localized string?
I have a settings page that shows the users wordpress role. I am using wp_get_current_user()->roles
get that list. However, that list appears in English, and often my users have their locale set to something other than English.
Is there a way to get the users role in a localized string?
Share Improve this question asked May 6, 2020 at 23:03 micahmillsmicahmills 1731 silver badge5 bronze badges1 Answer
Reset to default 1You can use translate_user_role($role)
function.
More details: translate_user_role()
https://stackoverflow/a/26187405/13466558