WordPress uses a concept of Roles, designed to give the site owner the ability to control what users can and cannot do within the site. Each role is allowed to perform a set of tasks called Capabilities.

learn more… | top users | synonyms (1)

0
votes
0answers
10 views

Multiple Authors on Single Post

Does anyone know how to assign multiple Users as authors of single individual posts (even single custom post types)? I want more than just displaying as tags the list of authors. I am looking at the ...
25
votes
4answers
11k views

Getting a List of Currently Available Roles on a WordPress Site?

When writing WordPress plugins there is often a need to set up options for which roles on the site have access to certain functionality or content. To do this a plugin dev needs to fetch the list of ...
1
vote
1answer
24 views

How to get all capabilities of an existing user role

How can I get ALL the capabilities of an existing user role (eg. Author) ? I'll be using it to quickly duplicate an existing user role, then create a new role then assign or remove capabilities to a ...
-3
votes
0answers
12 views

Unable to publish post [on hold]

A fatal error occurred whilst a plugin I'm using was creating a custom post. Since that moment, no admins can publish posts - only submit for review! Admins can still perform all other tasks ...
-1
votes
0answers
11 views

get_user_level in Front End Only Users

I'm using a plugin called Front End Only Users and I would like to use php to get a user's level so I can conditionally show hide information in a custom page template. I know I can use shortcodes to ...
1
vote
2answers
42 views

How to safely allow user upload on CPTs?

I have a form with a WP Media to allow user uploads for a custom post type on the front end. Every time I try to upload as a user I can the message You don't have permission to attach files to this ...
1
vote
4answers
1k views

Capability to edit own posts and not others

What is the capability that let users to edit their own posts and not others? I am trying to enable the post authors to avail a plugin function only on the posts they own. The permission to access ...
4
votes
2answers
75 views

How to update user role without logout

I am working on a wordpress project with the following plugins : Woocommerce Woocommerce product vendors WP Job Manager Wp Job Manager products I am trying to upgrade the user role after adding a ...
5
votes
3answers
2k views

How to let contributors to create a new revision(draft) editing their published posts

I'm using a custom post type to let contributors have a personal page on the site. Any time a user registers on my site a script creates a custom type post that has the registering user as the ...
0
votes
0answers
14 views

Custom post type shows all if no post from user

I'm trying to achieve this (without using any plugins): Adding custom post type Allow subscribers to create, edit, view their own posts "only" in wp-admin I'm using this code: ...
1
vote
0answers
15 views

Add custom capabilities to existing custom post type

The only way I can find to associate post types with custom capabilities is during the register_post_type function. I'm looking to add a capability for a certain role (my_role) for a post type that ...
2
votes
1answer
287 views

Allow contributors to moderate comments comments on posts they write

I run a multi-author wordpress site where we have a large number of contributors that can write articles, which are published after they are reviewed by an editor. (This is all standard wordpress ...
0
votes
0answers
12 views

Temporary Test WordPress Multisite Instances

What I need is a solution to setup a way for clients to test a plugin, in the backend, on a demo wordpress installation. Something like a temporary testing instance (wordpress multisite subdomain). ...
0
votes
0answers
15 views

Problem with the standard example of media_handle_upload

I have been trying to make a custom tab for the media uploader to treat some files and looked for a way to do such a thing, and found an example of it in the media handle upload page. The code I used ...
0
votes
0answers
13 views

Custom Post Type - after disable 'Add New', I can't edit and delete post

I need to disable 'Add New' button for my CPT, but when I add: 'capabilities' => array( 'create_posts' => false, 'edit_posts' => true, 'edit_post' => true, 'delete_post' ...
1
vote
1answer
13 views

Adding an additional role to an Administrator

User 19 is a WP Admin. $user = new WP_user( 19 ); $user->add_role( 'custom_role' ); The above code works and adds the custom_role role. However, when I run the same code on the ...
5
votes
1answer
8k views

How to assign multiple roles for capabilities array withini register_taxonomy function?

I am not sure how to add multiple capabilities to 'assign_terms' capability. My code is below, notice the capabilities array within the register_taxonomy function /* Registers taxonomies. */ ...
1
vote
2answers
2k views

How can I modify the Capability needed to access a plugin's options?

I have the following 3 different Roles: Admin, Editor, and SEO. I have installed WordPress SEO by Yoast, and I want to get this: I don't want the editors to see the SEO options, because they only ...
0
votes
0answers
26 views

add a custom user role and assign specific admin menu pages

There is wordpress function add_role to add a custom user role by adding wordpress defined capabilities like read, edit_posts, delete_posts, etc But I want to create a custom user role and assign ...
0
votes
0answers
18 views

Assigning custom capabilities restricting CPT usage

I want to activate my plugin with 2 or more CPTs. Everything goes fine with 'capability_type'=>'post'. Now I want to incorporate custom capabilities to my CPTs and want to assign 'em to the admin ...
0
votes
0answers
24 views

Custom post type only works when role has edit_posts capability

I have been trying to create a custom post type 'book'. Added capabilities when registering custom post type. All works well except I have to give user the permission 'edit_posts' when accessing my ...
0
votes
1answer
43 views

Remove Custom Capability

I have created a custom post type 'book'. All book post-type are public, so I want to remove some capabilities such as 'delete_private_books', 'read_private_books' etc. How can I achieve this since ...
1
vote
1answer
30 views

You do not have sufficient permissions to access this page on a submenu

I'm writing my first plugin for WordPress and am running into a permission issue when trying to pass a parameter to a page. I've added a submenu page to process a delete for a category from the ...
0
votes
2answers
94 views

User role permissions based on taxonomies

I was wondering if it's possible to set up user roles in a way that means that users in certain groups can ONLY edit posts that have a specific taxonomy assigned to them e.g: Properties (Post Type) ...
0
votes
0answers
28 views

How to add a dynamic image as a widget in dashboard

I'm trying to add an image as a widget on the dashboard screen like this: This is an ads image, which will be seen only by users with read role and that too will be changed every month. Already I ...
0
votes
0answers
14 views

Disable edit certain pages for author

How can I restrict editors to edit some pages (ID) in my wordpress site? The author can see those pages but should hide edit option. I have tried this snippet but it does not work: function ...
1
vote
2answers
51 views

how we can get Users List by Role in WordPress

How we can get list of all users that are in wordpress by the role or capabilities. for example: Display all subscribers list in wordpress. Display all authors list in wordpress. Display all ...
0
votes
1answer
38 views

Redirect admin 403 “Cheatin uh?” admin pages

Blocking role capabilities on the admin returns the 403 "Cheatin Uh?" page. What is the best way to redirect this to 403 page to perhaps the dashboard, homepage, or a custom 403 page? I know I could ...
0
votes
1answer
24 views

What is more secure checking capabilities of user or checking role of user in WordPress plugin development

Suppose I need to check the logged in user is subscriber not anyone else. So if I check the capability like "read". Then subscriber is OK but "read" capability is also associated to admin/publisher as ...
-1
votes
1answer
64 views

Sync roles across several plugins

Here is the setup: I am implementing Wordpress with two specific plugins: Ultimate Members and Yith Vendors which is a woocommece addon. What I need to do is change a field's data in the database ...
10
votes
6answers
6k views

Select subscriber as author of post in admin panel?

I want to be able to select a subscriber an author of a post in the admin so it displays their name as having written the post, but I do not want to give them any additional privileges (if they login ...
1
vote
1answer
59 views

REST API: How can I restrict a custom post type to only be accessible by authenticated users?

I have a custom post type configured to be accessible via the WP Rest API v2. How do I lock the access to this custom post type so that only the authenticated users can perform GET requests?
1
vote
1answer
47 views

Custom role capabilities to administrator not taking effect (no plugin)

I have created a custom post type from a plugin. I added a capability type teacher. Then I have added custom capabilities to administrator. But the problem is for the first time after completing this ...
5
votes
2answers
1k views

Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding 'capability_type' parameter

I got quite confused with Custom Post Type (CPT) 'capability_type' parameter and adding generated capabilities to a role. So I've got a CPT called 'external_role' registered as following: ...
4
votes
2answers
139 views

Change capability type of post type registered by plugin

I'm using the plugin Custom CSS JS which registers it's own post type but the capability is assigned to "post". I want to change it to "manage_options". Is there a correct way without altering the ...
4
votes
1answer
118 views

What's the difference between Role and Meta capabilities; When to use map_meta_cap() filter

I'm getting very confused about the following things: difference between Role and Meta capabilities, difference between Meta and Primitive capabilities, when to use map_meta_cap() filter. There ...
0
votes
2answers
465 views

Prevent Admin user to edit/see super admin from users list

How do I hide my super admin from the users list? My client has to be the ability to create users, but not edit/see my super admin user. Is that possible?
1
vote
5answers
10k views

what's the meaning of the field wp_capabilities in table wp_usermeta

I am new to wordpress, in table wp_usermeta I notice that we have a row meta_key meta_value wp_capabilities a:1:{s:13:"administrator";b:1;} First, what's the meaning of ...
0
votes
0answers
16 views

Allow user to edit same category posts published by other user

Is it possible to allow user edit their own posts and also posts that are published in same category by other users?
0
votes
0answers
18 views

Creating a project management plugin, projects are only seen/managed by admin

I went to make a WordPress plugin to manage my projects. I don't want to make my projects as public, only I(super_admin) should be able to see/manage it. Here is what I need: Adding Client ( as CPT ...
6
votes
2answers
528 views

Disallowing Users of a Custom Role from Deleting or Adding Administrators?

(Moderator's note: The original title was "Custom User Role Restrictions") A project I am working on requires me to create two new user roles - one for the owner of the website and the other for ...
0
votes
0answers
12 views

Remove QE options and edit link from the title for a custom status and based on capability without js

I'm trying to remove the quick edit option and the edit link on the title of the post in the admin post list. I'm trying to do that on user capability and a custom status. Basicly when a post have ...
0
votes
1answer
41 views

How to restrict author to only access one custom post type ?

My installed Wordpress have 4 custom post type and 1 default post type. Basically what i want is that the author can also access particular one custom post type. Author must not see other post types.
1
vote
0answers
22 views

Allow users to set a post author

I have a website owned by myself that allows people to submit work for us to publish. I have a team of staff who need to create posts..etc I have assigned users the author role which allows them to ...
0
votes
1answer
22 views

How to add a menu page for options in wordpress for user that has the role of vendor?

I want to add new options page ONLY for those users whose role is vendor. How can I do that? This is my current code. add_action('admin_menu', 'business_settings_menu'); function ...
2
votes
0answers
231 views

User-edit role setting distinct from wp_capabilities?

I need find out how $profileuser->roles is set. wp_capabilities can hold multiple roles, whereas user-edit role caters only for a single role. Under certain circumstances it is possible for there ...
1
vote
0answers
49 views

Cannot Create new Post within Custom Post Type

I have a custom post type registered and when registering I am using... if( !post_type_exists( 'email_template' ) ) { register_post_type( 'email_template', array( ...
1
vote
3answers
2k views

How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?

The default taxonomy, category. By default, only those with the edit_posts capability can assign categories during post creation/editing. I have a role with very limited capabilities. I want to let ...
0
votes
1answer
58 views

Force “submit for review” on update?

I'm trying to force all content to be submitted for review. That means that if a user updates an already published page, that the update would be pending until someone else approves it. I don't see ...
0
votes
1answer
26 views

Run only on plug-in activation instead of wp_head

I have below function on my plugin which adds more capabilities to current user. // Role setting for add media function wh_edit_roles(){ if ( current_user_can( 'edit_posts' ) ){ $user = ...