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)

17
votes
1answer
7k views

Editor can create any new user except administrator

I have set up a WordPress site for a client. The client has the Editor role, however I have installed the Members plugin and given the client the capability to add new users to the WP admin. This is ...
13
votes
2answers
6k 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 ...
9
votes
3answers
5k views

Is there way to rename user role name without plugin?

Is there anyway to rename a user role name via hook, instead of using plugin?
8
votes
4answers
900 views

How do I make a draft post accessible to everyone?

I have several unpublished posts in my Wordpress website and I am trying to make it accessible for normal users (who are not logged in) using the normal post slugs (site.com/post-here). I understand ...
7
votes
5answers
4k views

Remove Ability for Other Users to View Administrator in User List?

(Moderator's note: Original title was "Remove Admin from User Menu") I have created a client administrator role which is essentially an Editor with ability to add/remove users. The article "Editor ...
7
votes
5answers
3k views

WordPress SEO by Yoast: Hide Meta boxes in posts for non-admins

I have multi-author website and I am not very comfortable for allowing all members to enter SEO details in the posts they are publishing. I would like this would be visible only to Administrator of ...
7
votes
2answers
2k views

How to create a clone role in wordpress

How to create new role with same capabilities of existing role. Eg: I would like to create a new role with same capabilities of administrator or editor and so on..
7
votes
3answers
3k views

Groups of capabilities: users with multiple roles?

I'm pretty sure I understand the roles and capabilities setup in WordPress: granular capabilities, grouped together in roles that can be assigned to users. Code should check the granular capabilities, ...
6
votes
2answers
7k views

Possible to hide Custom Post Type UI/Menu from specific User Roles?

What I'm looking to do is completely hide the UI for a custom post type from specific user roles...Ive previously found many resources on how to disable access to using those CPTs but nothing that ...
6
votes
2answers
7k views

How do I create a custom role capability?

I wish to create a custom capability for accessing the interface of my plugin. Should the plugin manage adding this capability to all the administrator accounts on activation? If so: Does WordPress ...
6
votes
1answer
848 views

Allow Editors to edit pending posts but not draft ones

I have a large number of users with Editor Capabilities that help to go through the post submissions. This is my current setup for this role: As you can see, they are allowed to edit_posts and ...
5
votes
2answers
5k views

Defining capabilities for custom post type

On creation of a custom post type I'm trying to define capabilities but it's not working. What's wrong with this code? $args = array( 'labels' => $labels, 'public' => true, ...
5
votes
2answers
8k views

How to add a Capability to a User Role?

I am managing a Wordpress network and would like to add the unfiltered_html user capability to the already predefined user role of Admin. In a standard installation of Wordpress the Admin account ...
5
votes
1answer
410 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 ...
5
votes
1answer
798 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: ...
5
votes
1answer
1k views

How can I create a taxonomy meta-box with search suggestions but no new terms input?

I was wondering how I could setup a taxonomy metabox on a post edit page that would be similar to the "tags" kind (with search field and automatic suggestions), but without the right to add a new ...
4
votes
4answers
2k 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 ...
4
votes
1answer
2k views

add_menu_page permissions - what am I doing wrong?

I am running a fresh install of Wordpress 3.3.2 and the only plugin enabled is one I'm developing, but I can't seem to get past a permissions issue in add_menu_page. With the exception of using ...
4
votes
1answer
360 views

Can I make user role that can only access a certian content type?

I would like make a custom role that can only access a custom content type that I'm going to be creating in the admin. Is that possible and does any know of any examples or tutorias that I should ...
4
votes
1answer
143 views

What exactly is WordPress?

These are some very basic questions, so I apologize for asking them, but it's hard to understand exactly how some things work without spending dozens of hours experimenting with them. I'm more than ...
4
votes
1answer
609 views

Restrict Admin Capabilities in MultiSite

update_core update_plugins update_themes install_plugins install_themes delete_themes edit_plugins edit_themes Hi, I want to restrict those capabilities to user_id = ...
4
votes
2answers
720 views

Add custom user capabilities before or after the custom user role has been added?

Should custom user capabilities be added before the custom user role has been added, or the other way around? add_role() asks for and array of $capabilities in the third parameter of the function. ...
4
votes
1answer
355 views

Custom post type capabilities

I've got a somewhat unique scenario that I would appreciate some assistance with. I have a custom post type, coin, for content that is automatically created by an custom import process. I would like ...
4
votes
1answer
3k views

How to assign specific users the capability to edit specific pages / posts / custom post types

I'm trying to implement what seemed like a relatively straight forward idea, basically I am building an access control plugin to control viewing and editing of a custom post type (in this case ...
4
votes
1answer
39 views

Possible to make custom role in multisite that can add sites?

I am creating a network on MultiSite, and am wanting to keep the Super Admin privileges very tightly locked. This setup is hosed on WPengine, and they add their plugin in the dashboard that shows the ...
4
votes
1answer
105 views

Allow authors to edit only certain users

I am trying to give my "authors" (who I have renamed "captains") the ability to access the user profile of their team members and only their team members. The teams are defined by a user-meta box ...
3
votes
1answer
4k 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. */ ...
3
votes
3answers
1k 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 to my site a script creates a custom type post that has the registering user as author. To ...
3
votes
1answer
2k views

How to check user role without using current_user_can()

I am filtering the map_meta_cap() function, which is called from $user->has_cap (which is called from current_user_can()). I only want my filter to execute if the current user is an administrator, so ...
3
votes
1answer
453 views

Roles & capabilities GUI that does not create separate table

After reviewing plugins that deal with user roles and capabilities I concluded that I might be better off just hardcoding my settings into my functions.php file. This actually worked out well for me ...
3
votes
2answers
343 views

Adding capabilities to super admins

I'm developing a plugin that uses custom capabilities. Some of those capabilities need to be added to all users who are super admins. Currently, I'm using this code: $supers = get_super_admins(); ...
3
votes
1answer
679 views

How do I fix problems with users not being able to publish and only submit for review after upgrade of Multisites installation?

We have a previous WPMU installation that has been upgraded to a WordPress Multisites installation. Since upgrading to 3.3.2 from 3.2.1 we have problem with editors/admin not being able to post on ...
3
votes
1answer
778 views

Allow user to Edit Posts but not Add New?

For one of my custom post types I want a specific user to be able to edit existing posts created by admin but not be able to Add New posts. How can this be done? If I define the user role as not ...
3
votes
1answer
261 views

Restrict users from editing post based on the age of the post

How can I restrict users (based on Capabilities) from editing their published posts after a custom amount of time. For instance, a user that can publish_posts (authors) can not edit a their post if ...
3
votes
1answer
65 views

How to Structure a New Role/Capability Scheme?

I have a situation where I need users to be flagged as "Instructors" on a site. That role should basically be whatever the user's current role is with the added capability to see comments from ...
3
votes
1answer
51 views

How to not allow custom roles to edit published custom post types?

I have a WP site with a custom role (revisor) and a custom post type (events). What I would like to do is allow my revisors to add new events, but not edit existing. I'm already using the Members ...
3
votes
1answer
151 views

WordPress Capabilities: edit_user vs edit_users

The official documentation only mentions edit_users, but in the source I found many places are using edit_user, what is the difference? Are there any conventions for singular and plural capabilities? ...
3
votes
1answer
487 views

Temporarily give 'manage_options' capability

In order to allow editors to edit other's author meta (update_user_attribute), I must give them the 'manage_options' capability or else I get a 'Cheatin' huh' die message. I only want to give them ...
3
votes
1answer
339 views

The 'user_has_cap' hook seems to take two page loads to trigger

This question relates to another question I asked recently (http://wordpress.stackexchange.com/questions/29009/how-to-assign-specific-users-the-capability-to-edit-specific-pages-posts-cus/), the ...
3
votes
1answer
185 views

Can someone explain Wordpress caching, and what's the best in my scenario?

I'm creating a website that has two basic user groups: Subscribers and Editors. Bot can create posts via a custom form using wp_insert_post(), but Editors are allowed to mark a post as private, ...
2
votes
3answers
2k views

Capabilities and Custom Post Types

I have a custom post type that I'd like to restrict access to certain roles however, I've already added content using the custom post type and now I have to make them restricted. The capability_type ...
2
votes
1answer
852 views

Wordpress capability_type arguments

I don't know how to figured out what's wrong with my code, Why Custom Post Types "Book" doesn't show on my dashboard, I logged as Admin and I use latest WordPress installed 3.4.1 Here with my code ...
2
votes
2answers
233 views

What is the difference between “create_users” and “add_users” capabilities?

The codex lists both create_users and add_users under roles and capabilities. Does anyone know what is the difference between these two?
2
votes
2answers
106 views

How can I prevent a writer from being able to edit an article that has been scheduled?

In the old WordPress that I had, the writer (a type of user that could not publish) was, after an article was schedule, unable to go back to the article and edit it. But now in WordPress 8.1 they (the ...
2
votes
1answer
519 views

Temporary capability for current_user_can()

Is it possible to intercept calls to current_user_can() ? Example: current_user_can('rate', $post_id) There's no "rate" capability registered, but could I somehow hook into that function and do my ...
2
votes
2answers
597 views

Read only capability for custom post in admin area

I'm actually building custom type to WP and need to be able to restrict post access to some user role, ie. in admin area, collaborators can see posts but can't edit them, just only open them as ...
2
votes
3answers
2k views

Role that can edit only widgets, not other theme options

How could I make particular role access widgets administration menu (wp-admin/widgets.php), but not access other theme administration menu elements. I have got that far as to display Appearance menu ...
2
votes
2answers
1k views

What action should I hook into when adding roles and capabilities?

I'm going to be using add_role() and $role->add_cap() to set up a new custom role and attach a new capability to existing roles. I'm wondering where the best place to do this is? Obviously I can do ...
2
votes
3answers
513 views

What are the differences in capabilities between the super-administrator and administrator?

What are the capabilities that a super-administrator has that an administrator does not have? The codex page on user capabilities does not have a list of capabilities of the super-admin. It lists ...
2
votes
1answer
252 views

Add user capability and check against it

I just realized the following: // Call the current user info global $current_user; // Add a capability // and set the 2nd argument ($grant) to false $current_user->add_cap( 'some_cap', false ); ...