0
votes
0answers
23 views

Custom User Roles Added When Plugin Network Activated and not on Individual Site

I wrote a quick plugin which creates a list of custom user roles and capabilities for each user role. The user roles are checked and added if not found upon plugin activation. When I network ...
2
votes
1answer
124 views

Is there a simple way to manage capabilities per user?

I have a WordPress-Site where some people (non-expert clients) need to create/manage users. The site uses multiple custom post types and each user is assigned permissions for one or several of those ...
0
votes
1answer
36 views

Remove specific administrator's capability

I've created two administrator users X and Y. And now I need to remove capability of 'edit_plugins' from user Y. I've searched and found, http://goo.gl/LttuvX $user = new WP_User( 'Y' ); ...
0
votes
1answer
14 views

Privilege to recover trashed posts

I can't seem to find which built in privilege is required for recovering a trashed post. Would it be delete_posts, which is as its name suggests, can move items into the trash and remove them ...
0
votes
1answer
367 views

Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?

even though I think I understand the hierarchy of roles in WordPress, I never really bothered creating my own user roles or custom capabilities. What I need to achieve is to assign a few capabilities ...
0
votes
1answer
171 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?
0
votes
1answer
97 views

how do I add role and capability after I create a new user

I have a simple requirement: 1. create a user 2. create a role for the user 3. add capability for the role First, create a new user $uid = wp_insert_user($userdata); Second & Third, create a ...
0
votes
1answer
59 views

Completely remove ability to create users?

I have added the code below to a plugin: add_action( 'admin_init', 'remove_add_users_cap' ); function remove_add_users_cap() { $role = get_role( 'administrator' ); $role->remove_cap( ...
0
votes
1answer
425 views

How to restrict specific post types from being read or added by specific user roles (eg. author)?

I'm not very clear how to restrict admin area post types access to specific user roles. In my case, I have some post type such as "suppliers" which I do not want to show to "authors". By default WP ...
1
vote
1answer
274 views

How-to delay the capability to publish posts?

Spam has gotten a bit crazy so it would be nice if new users have to wait a week to post something. I use buddypress and all new members have the role of author. The site is more like a forum with ...
2
votes
1answer
254 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 ); ...
3
votes
1answer
346 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 ...
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, ...
2
votes
1answer
567 views

How to programmatically add a user to a role?

I want to programmatically add the current user to a role and also remove the current user from a role in a php page i created . am really stuck. thanks in advance
1
vote
1answer
68 views

Does an AJAX call on the Admin Side Automatically include the User Data/Capabilities?

I was wondering that if you do an AJAX call on an admin page and I wanted to see if the user had the capability to edit a page, would that info be sent along the call or do I need to manually sent ...
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 ...
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 ...
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 ...
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 ...
5
votes
1answer
413 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
4answers
643 views

Restricted registrations or removing the ability to edit your password/email

I'm developing a WP site that lists expensive properties (villas, penthouses, etc) for rent. My client has an agreement with certain schools to list some cheap properties exclusively for their ...
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 ...