The best way is to define a new role. An easy way to accomplish this is with the role scoper plugin. Otherwise you’ll just have to write that plugin yourself manually.
Here is a basic example pulled from the Codex
$result = add_role(
'basic_contributor',
__( 'Basic Contributor' ),
array(
'read' => true, // true allows this capability
'edit_posts' => true,
'delete_posts' => false, // Use false to explicitly deny
)
);
if ( null !== $result ) {
echo 'Yay! New role created!';
}
else {
echo 'Oh... the basic_contributor role already exists.';
}
Related Posts:
- WordPress keeps asking for connection information in localhost
- Front end user meta options for users
- Admins can’t edit each other’s posts
- Is there a simple way to manage capabilities per user?
- 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
- How do I customize the dashboard?
- Managing Users and Creating Groups [closed]
- Are User Levels Still Currently Used?
- Fix permissions for users role
- How to force authors to ‘submit for review’?
- Rest api return all users (even without content) to all users
- Can I check which users ran which updates?
- How do I let contributors edit their posts after being approved once?
- No user found when using REST API
- Does it matter if the very first user, usually Admin, does not have a user ID of 1?
- Groups and subgroups for permission
- Show posts who published after registration date
- User Permissions on custom post type
- WordPress install checking permissions of user id 0
- Are there any hook or filter when adding new user in WordPress?
- current_user_can() returning true for capability when the user and role do not have the capability
- Editor can create any new user except administrator
- Confirmation required on email change
- get_current_user_id() returns 0?
- List users by last name in WP_User_Query
- Email user when password is reset by admin
- How to work around “that email address has already been used” error?
- How can I run a WP-CLI command as authenticated user?
- How to redirect a specific user after log-in?
- How to Prevent deleting user accounts in WordPress Back-end?
- Hide update messages from non-admin users?
- Upload gravatar in WP profile?
- How to stop a user from updating the post date
- determining if the user is logged in
- Adding a photo to each WP user
- WordPress edit_user_profile_update update secondary role
- Check if user is online?
- set_role has no effect
- Is it possible to duplicate users on a new WordPress install?
- How to use search_columns in WP_User_Query?
- Get users only if Gravatar is specified
- WordPress to use Drupal users’ credentials
- Authenticate with a Rails app?
- How do I list in the backend all users that were assigned to a custom role?
- How to add local users to wordpress without email password?
- WP User Query fails when searching meta queries and search columns
- Suddenly all emails in User have [email protected]
- Updating user meta
- Subscribers become Authors after Upgrade? / Mass Update of Users?
- How to add a user profile page to frontend?
- Using Cloudflare caching on wordpress with front-end user logins
- Redirect user after successful email change
- get_user_meta an ID for multiple functions
- Reset Password policy
- Which function is called after update any field of user from any where of the site
- Register user when after filling contact form
- Is possible to allow user to login with different role?
- The Simple and Correct Way to Add User Meta
- Export Users and their Advanced Custom Fields
- Hide hour from displaying when using user_registered
- Allow unfiltered HTML for not logged in users when saving a post
- How to copy user_nicename value into user_login
- How to check User Role and redirect to specific page according to Role when login in WordPress?
- Users – remove ‘send password’ checkbox
- Send email to all registered users [closed]
- Send clear password via mail
- How to get users by specific ID’s WordPress
- how to set default update_user_meta values wordpress
- Didn’t get array of users like in delete action WPList table in users tab
- Cannot Update user meta in custom field
- How to programmatically read the plan text password when user register?
- Get user id after save post
- Redirect user to login if not logged in, on specific pages
- Check if user is logged in via JS? [duplicate]
- I want to change my user name
- Unique password to access a section site
- Cannot Modify Header Info Error on updating User Profile
- Is there a way to rate users instead of posts?
- Easiest way to create an user across several websites
- I need a link that directs the user that is logged to his profile
- How to change default username field after login
- Post Taxonomy Value get from User Field Value
- Iterating users while user iteration is suppressed
- In admin manage users page, how can I stop users with certain privileges from editing users with other privileges?
- Browser extension to allow users to submit posts front end
- user and usermeta table not found
- Users set passwords but cannot login
- Subscriber role – blank page
- Set user role on registration so can upload file to own media library area
- Ordering list of users by last name and then by first name
- is_user_logged_in() not working after domain change
- Get the author registration date in the header.php file
- Front end login and page restriction
- How i will get the images of highest scored users?
- Designing a member area on my site
- Integrating Facebook Registration (and Login) on a WordPress page
- 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?
- application password is missing