Names for a set of user capabilities.

learn more… | top users | synonyms (1)

7
votes
5answers
5k 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 ...
6
votes
1answer
957 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 ...
2
votes
2answers
2k views

How to limit user to publish post per day and per role?

I would like to know is there any way/Plugin to limit the user published post (in a given time span) by his role? Like this: Role A -> 1 post per day and 30 post total. Role B -> 10 post per ...
6
votes
1answer
2k views

add_role() run only once?

I was surprised to discover that add_role() modifies the database and fails if the role already exists. There are two implications here, one first more serious than the other: 1) if you're in ...
8
votes
4answers
1k 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 ...
18
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
3k views

Change Author Base Slug for different Roles

is it possible to change the author base slug in dependency of the role? For example, authors get example.com/ninja/%username% and subscribers get example.com/trainee/%username% ? I am thinking of ...
4
votes
1answer
1k views

Help to condense/optimize some working code

WordPress by default shows ALL posts to users who are Authors. I wanted Authors to only be able to see their own posts so I came up with the following code which works well. Any suggestions to ...
4
votes
1answer
7k views

Separate registration and login for different roles

I've set 2 new roles for my site using the "Members" plugin - "sellers" and "buyers". Each role should have its own registration page and login. A visitor can register as both a buyer and a seller ...
5
votes
1answer
4k 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
1k views

How to remove administrator role in settings -> general -> New User Default Role?

I don't want to accidentally select Administrator role. So is there a way to remove it from Settings -> General -> New User Default Role ?
2
votes
3answers
3k views

Change default admin page for specific role(s)

I was wondering if anyone knew of a plugin or a way programmatically to change the the default admin page for a specific user/role? I have a master panel page for my plugin currently setup with ...
9
votes
3answers
14k views

Allow member to have access to custom post type only. Permission to only edit their own posts

OK I'm looking for the best way to attack this. I'm very comfortable with PHP and making custom post types with custom meta fields in WordPress. Here is what I'm looking at doing: User registers ...
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 ...
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
4answers
7k views

How can I allow the Editor Role to change Theme Settings?

I've just setup a new Blog for a friend and thought it's better to not give him Administrator Access right away as a pre-caution. I created a new user as Editor therefore. But then I saw that this ...
3
votes
2answers
2k views

How can I hide a category from Contributors in the edit/add new post screen?

I have a situation where I need to hide a specific category and it's children from users who are logged in as Contributors. I don't want them to see this category and it's children in the categories ...
2
votes
1answer
952 views

Apply custom role capabilities to administrator (without plugin)

I have a custom role that allows access to only a sigle custom post type. This is all well and good, but now it is only showing up for this role, not for admin and super admin. I'm having a hard time ...
2
votes
1answer
2k views

How to prevent access to wp-admin for certain user roles?

I did try using the plugin Front End Users but this clashes with something as it prevents access to some front end pages. So I need to manually just set it so that anyone who isn't one of two ...
1
vote
3answers
2k views

Code needed to only show users own posts in a multi-user account

I am using WP3 and want to starting adding users (many users to a single blog) but when I give a new user an account, they can see all the posts in the admin including scheduled, drafts, pending ...
6
votes
2answers
585 views

How to prevent a post from being deleted?

For auditing issue, I only want a post can be trashed, but not deleted - for all users. So I have a plugin like add_action('before_delete_post', function($id) { wp_die(0); }); But ...
4
votes
2answers
171 views

How can I display all Multisite blogs where this user is administrator?

Given the user ID, how can I display all the blogs where this user is administrator? I tried: <?php $user_id = 2; $user_blogs = get_blogs_of_user( $user_id ); echo '<ul>'; foreach ...
4
votes
2answers
4k views

Help - Why my roles are not showing? Multi-site/Network

My network is showing roles in some sites and not in others. For some reason that I can't explain, when I add a new user, I have no role to choose from on the drop down box of a sub-site in my ...
0
votes
2answers
603 views

Ordering users of a specific role by last name

I'm trying to display a list of authors by their last name. I can get the list to display but as yet I don't seem to be able to order the list by last name. Any help would be greatly appreciated. Josh ...
4
votes
1answer
979 views

Only allow administrators and editors to access wp-admin

I am trying to restrict access to wp-admin so that only administrators and editors are allowed. At the moment I am using this function: function restrict_admin(){ //if not administrator, kill ...
2
votes
2answers
280 views

Set a maximum upload count for users on a specific user role

For users with the Contributor user role, I want to restrict the total amount of images that they are allowed to upload. I found this code posted on an answer here: add_filter( 'wp_handle_upload', ...
2
votes
2answers
104 views

Remove Ability for Administrators to Delete Administrators

I've been studying roles and capabilities and have worked with and worked up a bunch of awesome code for creating unique capabilities and roles. I have created a "Master Editor" role to maintain users ...
2
votes
1answer
243 views

Display Author role in archive or author page

I want to display author role on archive and author page outside loop I found this code on stack overflow and it works fine within the loop function get_author_role() { global $authordata; ...
1
vote
0answers
70 views

Editor and contributor roles not correct after adding function

** RESTATED ** I am creating a bridge. The work involves a default installation of WordPress and a plugin to bridge a forum and WordPress. The forum provides all the account information. The ...
0
votes
1answer
195 views

How to reload the role specific registration form on validation errors?

I test a solution for separate registration for different roles and it works very well. But the validation part/function (see bellow) on errors reloads/reuse the generic registration link and not the ...
0
votes
2answers
1k views

Order users by custom user meta

I'm showing a list of users like so: <ul> <?php $directors = get_users('role=director'); foreach ($directors as $director) { $dir_id = $director->ID; ...
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 ...
10
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?
5
votes
4answers
2k views

How to hide media uploads by other users in the Media menu?

Simply put - how might I completely hide media files uploaded by any other users other then themselves? Id like to disable access to these links & files since they are a way for non-admin users to ...
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
2answers
13k views

How to check if a user is in a specific role?

I have a pretty specific requirement to show different text in a field label on the user profile page based on the current user's role. I can't seem to figure out how to check whether the current use ...
6
votes
2answers
5k views

How to get role of user

I need to get the role associated with a user -- not the "currently logged in user". I am using Buddypress (not that should matter to the nature of this question) and I am in the bp_members() loop. ...
4
votes
2answers
778 views

Allow roles below admin to add subscribers only

I want to give a group of user types (Editor + a custom role) the add_users /create_users capability. The only catch is that I wanted to limit that capability to adding 'subscriber' type users only, ...
3
votes
1answer
203 views

Send a confirmation of user role upgrade conditionally

I'm using this snippet of code to send a confirmation email to user's when their account is upgraded to a new user role. function user_role_update( $user_id, $new_role ) { $site_url = ...
1
vote
3answers
416 views

How to assign capabilities to user NOT to User Role

Is there any way to assign custom capabilities to user, I'm NOT talking about User Role. I'm running a multi author blog where I assigned user role of "Author" to all of my authors. But I need a ...
0
votes
2answers
1k views

How do I redirect upon login a specific user based on role?

I'd like to force a user to a specific page upon login based on their role using if ( current_user_can('contributor') ) and the main login function function wp_loginout($redirect = '', $echo = ...
7
votes
3answers
4k 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, ...
4
votes
1answer
366 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 ...
3
votes
3answers
5k views

Disallow user from editing their own profile information

I'm currently developing an intranet and I am using Justin Tadlock's Members plugin to control roles and capabilities. I have created a HR role to allow Human Resources staff to create and edit user ...
1
vote
1answer
974 views

pre_get_posts Remove posts based on meta value with 'post__not_in'

I am attempting to alter the query of pages where the post meta value of _members_access_role does not meet that of the currently logged-in user. Here is what I have so far: // Get all posts with the ...
4
votes
2answers
3k views

Send user activation email when programmatically creating user

I wondered if someone here might be able to help. Basically, I've created a custom registration form that when validated, inserts a user to the user table. function _new_user($data) { // ...
4
votes
4answers
3k 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 ...
2
votes
2answers
526 views

How to filter the role selector?

I know that roles in WordPress are not hierarchical, but I'm wondering if there is any type of capability to "assign users to roles". All I can see if being able to add users or not. The real kicker ...
2
votes
1answer
558 views

How do I properly format the user_role array?

I used a role editor recently and needed to delete a role. After deleting it I noticed that it began to appear as blank in the edit user role drop-down. After a bit of investigating and deleting ...
1
vote
2answers
567 views

Menu page with list of users

I need a way to create a menu page with a list of all users for administrative purposes. The list will be used by users that don't have permission or acceses to the "Users" menu page. The page need to ...