The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
4answers
16k views

How to change a user's role?

I have custom roles in my setup and I want to be able to automatically change a user's role thru a function. Say user A has a SUBSCRIBER role, how do I change it to EDITOR? When adding a role we just: ...
4
votes
4answers
167 views

Create un-removeable user

How can I add a Wordpress user that can't be deleted (at all cost, not even by a superadmin) with some code? I can't find anything on Google about such a god-account. This morning a client of our ...
4
votes
2answers
838 views

Why does my custom WP role need edit_posts to edit images?

This may be obvious to someone other than myself. I think I remember reading somewhere that an "image" is indeed a form of "post". I have a custom post type called "listing" I have a custom WP role ...
4
votes
1answer
42 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 ...
3
votes
1answer
454 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
1k views

Associating an “author” with a custom taxonomy

I have a custom role, "Ministry Representative", which is able to log in and create and manage their own "Opportunities" and "Events", which is each a custom post type. On the front end of the site, ...
3
votes
1answer
671 views

Assign a Custom Role to a Custom Post?

I been looking around for this, but couldn't find a way. The scenario is: I have a custom post type 'Company', and I'm creating Company type posts through my plugin's code. When I create a new ...
2
votes
3answers
4k views

Access on specific pages in wordpress for a specific user

My Question is regarding User access control in wordpress I have two user - admin (admin access) and user1(editor). My requirement is admin can do any modification in admin site. But user1 can only ...
2
votes
2answers
122 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
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
1answer
921 views

Prevent or Disable creating new users or changing roles of existing users to Administrator

I am trying to give more permissions to the editor role by giving it access to create user accounts. See the code below. But I would like to prevent it from creating or editing existing users with the ...
2
votes
1answer
497 views

Limit access to page depending on user level

I've been asked to build a WordPress that limits access to posts with a particular custom post type based on the logged in users level. There will be a number of pre made user roles and they would ...
2
votes
3answers
578 views

Customize Admin Users Screen based on Role

I've added a role of "Customer" and I am working on customizing the Users Screen for that role. What I'd like to do is customize columns based on that particular role. Note: For example, take a ...
2
votes
1answer
122 views

Is there a way to localize role labels?

I'm using Justin Tadlock's Members plugin to create new roles and WP Role on Registration to display them on the registration form. I've got a multilang site (English and Spanish) and I've localized ...
2
votes
1answer
227 views

Users roles, make a page belonging to multiple users

I have a website with a lot of users. They are all editor (with same custom roles). They can add page and post, and edit only their own page/post. But some users need the ability to edit some ...
2
votes
0answers
36 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 ...
2
votes
2answers
103 views

Unify the roles and caps?

I installed several plugins(buddypress-docs,achievement,bbpress), each one create capabilities for their own post_type. I would prefer to make all roles and capabilities unified into one system, Is ...
1
vote
3answers
279 views

Using author_can() on custom post types in WordPress

I'm trying to conditionally display some content in a theme using custom roles and capabilities. First, I define a custom role: add_role('free_vendor', 'Free Vendor Listing', array('read', ...
1
vote
1answer
50 views

Ability to only view (not edit) other user's personal profile information

I have created 2 roles, Center and Student, for my WordPress website with different capabilities using members plugin. I want the student role users to be only able to view and edit their personal ...
1
vote
1answer
152 views

Add role across network in multisite

I have been trying to add new wordpress roles and capabilities, in a multisite installation, using the code below. The issue is, it only applies to the 'main' site of the multisite, and does not ...
1
vote
1answer
913 views

edit role display name and label name without plugins

I'am creating WordPress function for editing role name function change_role_name($role_name, $new_role_name, $display_name) { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles ...
1
vote
0answers
36 views

Custom Field to a Role?

Is it possible to add custom field to a custom role? Say I want to create roles that represent a membership level and want to add billing options to it. So it'd look like this: Membership level ...
1
vote
0answers
25 views

Add custom role across network in multisite

Maybe this is a duplicate of Add role across network in multisite, but the answers there are not conclusive so I'm asking again. Any help would be deeply appreciated. I'm trying to add two new ...
1
vote
0answers
187 views

Custom role conflict with NextGen-Gallery [closed]

EDIT: I've discovered that on a clean install of Wordpress and a reset database, the NextGen plugin appears to return this error with any standard Wordpress role except Administrator. Perhaps I ...
1
vote
0answers
60 views

Purpose of Adding Capability to Role But Not Grant?

I am attempting to create a custom role upon activation of my plugin. Along with that role, I wanted to add new capability to that role to access later. Now, after reading the Codex, I am totally ...
1
vote
0answers
86 views

Filter Menu Items by Custom User Role in a page

I want to create a page template where the contents of the menu is filtered. Say, on Template 1, I want only the pages/post created by a custom access role areamanager1 to be displayed on the Menu on ...
1
vote
1answer
336 views

How to check user role?

I have functions that have to execute based on the user roles. How do I check the user role so that I can insert the respective function under their role? EG. if ($_GET['role'] == "free member" ) ...
0
votes
1answer
169 views

How to set where user is redirected to after logging in at wp-login?

So i'm fairly certain this probably has something to do with the fact that I'm using a custom role I've set up in my functions.php file with almost 0 permissions. However, I'm still able to access ...
0
votes
3answers
702 views

Check whether user can delete a given post

I have run into this problem where the following piece of code always returns true for any post ID supplied to it. current_user_can('delete_posts', $post_id); Normally, the above code should return ...
0
votes
1answer
103 views

Assign multiple roles , overlapping capabilities

What happens if i assign let's say 2 different (custom) roles to a user that both of which have the same (custom) capability?
0
votes
2answers
991 views

reset the users roles - is there a way to do this?

any way would be acceptable for me, even hacking the DB. I have messed up the roles with MEMBERS plugin, and i need a way of reseting the roles somehow. i can't seem to find a proper way. ...
0
votes
1answer
514 views

How to order posts by custom WP role?

I currently have the following custom wp_query which displays posts from 2 custom WP roles, "custom_role_one" and "custom_role_two". It displays the posts from my custom post type of "listing". It ...
0
votes
1answer
29 views

Create custom role, multisite, add users/sites?

I have seen similar questions however the one I found asking a question close to this was never answered. I am attempting to create a role for our support team on our MultiSite install where they ...
0
votes
2answers
87 views

Prevent user from editing others posts

I have declared a new post type and it is visible on the admin menu: function create_post_type() { register_post_type( 'employer_fm', array( 'labels' => array( 'name' => ...
0
votes
1answer
54 views

Preventing role reading others posts

I've got a custom post type that I want to allow a specific user role to add posts to, however they must not be able to read posts from others. Here's my custom post type code: ...
0
votes
1answer
531 views

Roles and Capabilities in Custom Post Types

Is there a way to create one role with one capability and apply it to some of the custom post types? What I am doing right now is ending up with applying capabilities to all of the posts.. creating ...
0
votes
1answer
187 views

How to add only a (sub) capacity to an user role?

I know I can add capabilities to the any role using the role object and add_cap via functions.php <?php // get the the role object $editor = get_role('editor'); // add $cap capability to ...
0
votes
2answers
599 views

How to hide plugin options for editors via functions.php

I've read the entry Best Collection of Code for your functions.php file, it really help me a lot. I only got a question, is there a way to hide some plugins options (in their respective ...
0
votes
1answer
189 views

Removing capabilities from cloned admin role

I'm trying to create a new role within my wordpress theme that has almost all the same rights as an admin. Basically, it's a cross between Editor and Administrator. One of the issues I'm having is ...
0
votes
0answers
11 views

Restrict all possible back end options for users

I was looking around for the best BACK END user restriction plugin. I could not find a plugin that is capable to restrict ALL POSSIBLE AND SINGLE OPTIONS. They all allow you to restrict basic options ...
0
votes
0answers
14 views

How to publish custom post type for custom role user and not “submit for review”?

I've created a custom post type 'openproject', where i set capabilities. function custom_post_openproject() { $labels = array( 'name' => 'openproject', 'add_new' => 'Add new ...
0
votes
1answer
29 views

CPT, Custom User Role and problem with user manager

i've create a custom user role using this code: /* aggiungi ruolo */ add_role('brokers', 'Brokers', array( 'read' => true, // True allows that capability 'edit_pages' => true, ...
0
votes
0answers
29 views

How to filter user list by role on page template

The template below displays a directory of restrict content pro users. It works just as it should. I'd like to now filter these results based on custom role (let's say "member"). I thought I could add ...
0
votes
0answers
19 views

User is not being deleted from wordpress admin dashboard

I have a wordpress blog and I'm trying to delete a certain user from my admin dashboard. But when I delete this specific user and refresh the page, he remains on the users list. The only thing that ...
0
votes
1answer
73 views

Add role and edit page capabilities

i've create a new user role and i want this user can edit page and use custom post type. For custom post type i've resolve but for the page not function. On backend the user can only see the page ...
0
votes
0answers
29 views

Adding post tags without capability edit_posts

I have a custom role called Event Contributor whose capabilities are limited to the post type "events". The role does not have the capability "edit_posts". The post type "events" has custom ...
0
votes
0answers
50 views

Assign Role and capablitis on frontend registration

I have created 2 custom roles "customer" & "employee" form admin "members" plugin. I am trying to assign these to user registering for site according to options (customer & employee) they ...
0
votes
1answer
91 views

Custom post type media upload error with custom user role

I have created a custom post type named product and assigned a new role manager for it. Everythign works fine, except the media uploader for product. I can even upload images without any error ...
0
votes
1answer
17 views

Limit roles displayed in users.php depending on custom role

I have setup my WordPress installation with a custom role called 'regional_manager' I have given this role the capability to add_users and managed to create a custom snippet for my functions.php file ...