I think your function nesting is slightly muddled; call ucfirst
after translating, like so:
esc_html( ucfirst( translate_user_role( $user->roles[0] ) ) );
My bad, completely skipped a beat there. You should instead be using:
translate_user_role( $GLOBALS['wp_roles']->role_names[ $user->roles[0] ] );
It’s unreliable to assume that all role display names are simply ucfirst( $role key )
. If that still does not work, are you sure the language files you’re using have fully translated WordPress?
Related Posts:
- How do I programmatically set default role for new users?
- How to programmatically add a user to a role?
- Order users by custom user meta
- List total number of users that are authors
- exclude roles from overview
- get approved users only ( ultimate member plugin )
- Query users which have same dynamically generated roles as the current user
- Menu page with list of users
- How to get a users list by who created them?
- List of users with email and role
- Can someone help me out? Why isn’t this working?
- List users of specific role instead of removing them with specific role
- translate_user_role doesn’t work
- If the current user is an administrator or editor
- How to check if a user is in a specific role?
- allow editors to edit menus?
- Getting a List of Currently Available Roles on a WordPress Site?
- How to change a user’s role?
- Editor can create any new user except administrator
- Is there way to rename user role name without plugin?
- How to create a clone role in wordpress
- How to allow an user role to create a new user under a role which lower than his level only?
- How to add a Capability to a User Role?
- Why are my roles not visible in a Multi-site/Network?
- How can I get a list of users by their role?
- How to get role of user
- Remove Ability for Other Users to View Administrator in User List?
- How to allow editor to edit privacy page / settings only?
- How do I make a draft post accessible to everyone?
- Reset default roles and capabilities
- Find out if logged in user is not subscriber
- add_role() run only once?
- Groups of capabilities: users with multiple roles?
- User-edit role setting distinct from wp_capabilities? [closed]
- What do unfiltered_html and unfiltered_upload actually filter?
- wp_update_user not updating
- Check if user is admin by user ID
- Temporary capability for current_user_can()
- Allowing users to edit only their page and nobody else’s
- alphabetically order role drop-down selection in dashboard
- Create custom user role (client) that can create another custom user role (employee) of that client
- Execute a function when admin changes the user role
- Is it possible to add new user Roles?
- Allow roles below admin to add subscribers only
- How to let contributors to create a new revision(draft) editing their published posts
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- What the user_status column?
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- Hide Admin Menu for Specific User ID who has administrator Role
- How to hide media uploads by other users in the Media menu?
- Show admin bar only for some USERS roles
- Grouping users under parent user
- How to auto-translate custom user roles?
- Temporarily give ‘manage_options’ capability
- REST API, get user role?
- Is WordPress’ is_user_logged_in() secure?
- How to force listing contributors in authors dropdown menu
- Set a maximum upload count for users on a specific user role
- How to update user role without logout
- How to check user role without using current_user_can()
- Hide specific admin users’ posts
- Allow authors to edit only certain users
- How do I allow a specific Role in WordPress 3+ to only see certain plugins?
- Do not allow users to create new posts and pages
- How to update role capabilities
- Allow editors access to added plugins
- Temporarily disable user role login and replace with message
- How to filter the role selector?
- create users to site with specific language
- How to loop through each user id?
- Code needed to only show users own posts in a multi-user account
- How can I change a user role upon visiting a page?
- How to let the Contributor role preview unpublished posts?
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- Change role after the user has read all the posts in a category
- Do custom user roles have any default capabilities?
- How to enable the theme editor cap for an editor role?
- Filter available WooCommerce payment gateways by role [closed]
- Ordering users of a specific role by last name
- How to assign capabilities to user NOT to User Role
- Prevent user creating new users with specific roles
- How to assign an additional/extra/second user-role to multiple users (of a specific user-role)
- How to stop a user from updating the post date
- Modify custom Users Manage page
- Restrict Author to pick from media library, but not upload media
- Can i copy administrator role to another user?
- how to add custom user capabilities using add_user_meta or something else?
- Assign Subscriber capabilities to a custom user role
- BuddyPress | Check if user is in current group [closed]
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- User roles – enable custom posts disable posts
- Return ID of authors who have at least one post
- How to change role of all users with a specific role to another role?
- Allow user to Publish, but not Edit or Delete
- Roles at registration (classipress)
- How to allow registered users to change their user role through frontend?
- Remove Ability for Administrators to Delete Administrators
- how to change user roles for users who doesn’t have any. (about 8000 users)
- Customize Admin Users Screen based on Role
- WordPress edit_user_profile_update update secondary role