You’r following an bad idea.
What you would like to reallize is, displaying a few profiles, not all. It doesn’t matter if the role is named “king” or “queen” even if your specific roles called so.
There is an better way to reallize such Kind of requirements: Capabilities
. Add an capabilitie
to WordPress and just give that view roles you would like to Display that capabilitie
.
Then you are able to Change the Name of the role or define new “visible” roles without Messing arround with your code.
Related Posts:
- If the current user is an administrator or editor
- user_login vs. user_nicename
- WordPress usermeta scaling for thousands of users
- Execute a function when admin changes the user role
- Best way to send users password?
- Why are user address fields required [closed]
- Importing users? From another wordpress site
- How to discover and delete unused accounts?
- Multi-steps WordPress registration : in 4 steps how to?
- Allow guests to save favourite pages?
- Basic auth WordPress REST API dilemma
- Remove all users from site except one using WP CLI
- security+best practices: root or www-data on a wordpress content folder?
- Show Biographical Info while creating new user
- How to enable the theme editor cap for an editor role?
- WordPress keeps asking for connection information in localhost
- User File Upload Repository?
- How to get user ID during registration and add it to a custom table
- How do I properly format the user_role array?
- How can I secure a WordPress blog using OpenID from a single provider?
- How to edit user_id on the comment edit screen
- get_users() ORDER BY Not Working
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Tagging users in WordPress
- How can I display show/hide elements when user is registered?
- How can I allow password reset based on logins containing the @ character?
- WordPress User getting added with id of 0
- Log all users out of all locations after 24 hours
- Register new user in the frontend
- RSS feed for a given user’s post?
- add_cap not working with Shop Manager role
- User Last Login Sort Column
- get_users() timeout on big userbase — options to divide query?
- Plugin for limiting user registration based on ip with expiry period?
- Bulk delete users from a csv list
- Get tags for current user
- Using user_status in conditional with get_users to return existing users
- Split Blog Into Two Sections?
- Users managed to register on website with no register button?
- Is there a way to make custom fields only editable by administrators?
- How to use WordPress for class notes?
- mysql query two database tables, users and usermeta and sort by custom meta int value
- How to Check User type from the form user registers in user_register hook?
- Add value in user table when user is created
- How to hide WordPress users’ names externally?
- Force user to change their password on the frontend at the first login and password policy
- Should I encrypt the response that triggers an Ajax action? Is nonce sufficient?
- Editable registration date field in user profile
- How to force authors to ‘submit for review’?
- Turn off password requirement
- How to duplicate a wordpress user and all his/her data from custom fields?
- Add a role and give admin priviledges
- WordPress registration without wp-login.php and wp-admin folder, is it possible?
- List users by meta_key and meta_value
- MySQL query to mass change role of users
- Use WordPress Login for a non-wordpress site
- How to change user`s avatar?
- Add Custom Filter to Admin User list
- WordPress SQL Issue not returning correct reselts
- How to Create a User Profile Page?
- List Users alphabetically with heading
- How to default/force the user’s display_name to their nickname?
- how to remove email field from default user registration form on wordpress
- How can I change “Users” related labels in the wordpress dashboard
- Add custom user meta data
- Does it matter if the very first user, usually Admin, does not have a user ID of 1?
- Groups and subgroups for permission
- User can manage one page accessible by everyone?
- How to add an attribute to a user?
- SELECT from wp_users, get Displayname too
- Redirect current user to their most recent custom post
- how redirect users to custom login page when “login to reply” is clicked? [duplicate]
- Making WordPress available while logged into another website
- Get user ID when action row link is clicked
- Advanced Custom Fields Plugin: how would I get an image src path uploaded from User Profile?
- how to delete in phpmyadmin sql – all users with certain condition and all dependencies
- User with same Mail but a different additional info(like domain)
- current_user_can() causing critical error
- How to connect wordpress user with my own APP user?
- How to Moderate Edits to User Profiles?
- Front-end uploader logging user out when they attempt to upload image
- WP users cant reset password
- Limit a user only to wp-cli only use
- WordPress session times out – but doesn’t log out?
- Registration page as homepage
- How to add karma points to users?
- New User ID not working in custom function with user_register hook
- Registered access area
- Error when send reset password
- User management missing after migration to new host
- Add new user and user bio at same time
- How to create a link to a user’s profile page
- Validate user meta and redirect
- Let admin users edit member profiles from front end
- Storing additional information about the user
- Current User Seeing Another Logged In User Info
- What techniques can a user employ to achieve a password rated “strong” in the WordPress password checker
- New User Registration email
- Can I provide a user’s user_ID to them and can it also be searchable in a member’s directory
- application password is missing