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
- How do I make a draft post accessible to everyone?
- Find out if logged in user is not subscriber
- User-edit role setting distinct from wp_capabilities? [closed]
- Allow roles below admin to add subscribers only
- 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 auto-translate custom user roles?
- How to force listing contributors in authors dropdown menu
- 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
- Allow editors access to added plugins
- Temporarily disable user role login and replace with message
- Change role after the user has read all the posts in a category
- Do custom user roles have any default capabilities?
- Filter available WooCommerce payment gateways by role [closed]
- Can i copy administrator role to another user?
- How to prevent users with “edit_others_posts” capability from editing admin posts
- Access on specific pages in wordpress for a specific user
- similar to Editor can create any new user except administrator
- Locking Down WordPress Application Password Permissions / Capabilities
- Can a user with admin role get ‘Sorry, you are not allowed to move this item to the Trash’ error when trashing a post?
- Users roles, make a page belonging to multiple users
- Users Unable to Access Dashboard/Posts/Pages
- Are there individual memory allocations for different user roles in WordPress?
- How to redirect specific post type with user role
- Prevent Editors from Editing/Deleting Admin Accounts
- create shortcode to list users with specific meta key value
- Membership subscription, change user role when subscription runs out
- Change user role after bulk-import
- Remove Capabilities from WP admin for specific user role
- Show metabox for a special role
- wordpress user roles are not working
- Execute a ultimate member action when user role is updated
- What are some best practices for user exit strategy?
- Is there a way to identify a user in a custom REST API method? [duplicate]
- Problem with automatic role change through cron job
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- Custom capabilities to add, edit, remove users of a particular role only?
- Limit number of users a role can create
- read_private_pages capability not working for new role
- Hide custom post type by user roles
- Understanding State in WordPress Multisites
- List users of an array of roles
- Load user by specific role
- Add User Role: Pre-saved in User-Meta [SOLVED]
- Want to know parameters that can be passed to user_can() for access control by user capabilities
- Block user roles from accessing the WordPress dashboard
- Can we hook the Customizer on a post or page on the front of the site?
- How should I setup the “Users” area to hand over to a client?
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- Get users with different roles and call function on each of them (user_meta)
- Plugin privelages for “editors”
- User role editor – Add download files capability
- Newly created user role not displaying on users screen
- Error while creating a clone role in wordpress
- Change auth_cookie_expiration for specific roles and specific login times
- Infinite redirects at front end if logged in user is not an Admin (Toolset Access)
- Set user role, if an specific role created an user
- Block access to plugins.php for custom role
- Allow user to select role from front end edit profile form
- Restrict Author to post only to a specific category
- Set “editor” role to existing user
- Enable plugins for a specific user role
- Woocommerce customer role doesn’t change if user is already a subscriber [closed]
- Custom User Role – can’t edit or publish pages?
- Dropdown of user roles that depend on variable
- Add role selector to custom registration page
- Groups roles & capabilities
- Why does user_can return false for a capability during plugin deactivation?
- Removing Admin Bar Node Based on Role
- Create an email address that forwards to users in role
- How to update user role totals
- Button for users to upgrade their user role + Button to show current user role!
- Get Sticky User in user loop based on user role
- Restrict Access to the User Profile
- Welcome email specific to user role
- How create a multisite setup with “phantom” accounts and passwords?
- How to get only 1 role from user
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- How to change user role setting in members plugin so that user can only edit his own post?
- How to lock users account until approvation
- WordPress users roles wp-admin
- How to create a User Role and give permission to only use Web Stories plugin?
- User roles empty
- How to add custom user role into wordpress