You can use current_user_has_role
for this
And if the standard roles are not enough for you, then I would suggest to download the Members plugin by Justin Tadlock which enables you to add roles.
Related Posts:
- How to restrict access to uploaded files?
- throttle/limit a logged in user’s http requests to specific page on a per day basis
- How to programatically change username (user_login)?
- Allowing users to edit only their page and nobody else’s
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Hide Admin Menu for Specific User ID who has administrator Role
- How to hide media uploads by other users in the Media menu?
- Allowing an email as the username?
- Check if specific username is logged in
- Post list based on the user that is logged in
- Basic auth WordPress REST API dilemma
- Copy a user from one WordPress site to another
- User File Upload Repository?
- Front end user meta options for users
- add ‘file upload’ field to user details
- How to customize wp_signon()
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Set default page for user account in admin
- Share user table from WP with Drupal
- Log all users out of all locations after 24 hours
- Hide everything on site for visitors except specific page IDs
- Rule to redirect non logged in User to Custom Registration/login Page in .htaccess file
- Managing Users and Creating Groups [closed]
- show text If special user is logged
- Upgrade Nightmare – No Posts, Permissions Issues and Can’t Create a new post
- How to disable a specific page for a specific user
- Allow user access to Dashboard only!
- wordpress user roles are not working
- Displaying different in-page content to cliente/admin
- Problem with automatic role change through cron job
- Reset Password policy
- How can I allow an User to publish only 5 posts per month?
- Where are $current_user->allcaps set?
- How do you manage your pages or functions that require logged-in users?
- Allow admins to login as other users
- Can I Create a Second Admin Level User Role?
- Delete a user from frontend
- Unique password to access a section site
- One Click Access To Users Account In WordPress?
- Using my own user table
- Allow users to upload flash videos?
- WordPress user role with create user capability?
- Update user role for expired membership
- How do I set a maximum upload size for a specific user role (Editor)
- Front-end uploader logging user out when they attempt to upload image
- Iterating users while user iteration is suppressed
- How to use url formatter with integer
- Custom User Role: Can Edit Own Page, Cannot Create New
- WordPress install checking permissions of user id 0
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Restrict Access to the User Profile
- post acces for guests / unregistered users only
- Username has been exposed
- view and update form only for registered users
- Control Category of each user can post
- Limit user access to installing/configuring a plugin?
- determine active user browser at the same time
- MySQL query to list users who never signed in
- Wordpres password as plain text in email
- WordPress password as plain text in email
- Confirmation required on email change
- get_current_user_id() returns 0?
- Upload gravatar in WP profile?
- Recover the user that have been deleted
- how to get recent registered author id?
- Get users only if Gravatar is specified
- Authenticate with a Rails app?
- *wpupdateuser* user_login in my WordPress database
- Updating user meta
- Changing a username
- Are User Levels Still Currently Used?
- Delete users from multisite after they have not logged in for a set amount of time?
- Where is the information about the authors for articles stored?
- Fix permissions for users role
- Redirect subscribers to last viewed page after log-in
- User Meta Data in a Sortable Table
- search users using user name and user meta in wordpress
- WordPress Login Customization for External Authentication
- Create a “user log”
- WP_User_Query combining role and ids
- Adding fields to the “Add New User” but the form data not saved into DB
- Admin approval for editing user profile
- Editor role can only create/edit/delete users who have one of two roles
- Can’t add user- wrong message “this user name is invalid because it uses illegal characters”
- WordPress 5.8 – Hide or Remove personal fields from admin Profile page
- change user password REST API
- Append USER ID to an outbound link?
- How to destroy all user sessions via WP-CLI
- Is a list of user names or IDs in a custom profile field the best way to create a followers list?
- Get meta key with value for user
- Get the author registration date in the header.php file
- Front end login and page restriction
- i need to let a user to add a role from a frontend form
- Integrating Facebook Registration (and Login) on a WordPress page
- You do not have permission to access this document on form submit
- WordPress C# User Login
- Why does a super admin on multi site get a rest_user_invalid_id error code when requesting user details through REST?
- Cant edit profile from frontend
- application password is missing