The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
4answers
12k 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
159 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
1answer
37 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
2answers
629 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 ...
3
votes
1answer
446 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
597 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
3k 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
3answers
1k 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
932 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
2answers
80 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
364 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
1answer
720 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
3answers
501 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
90 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
223 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
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
269 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
30 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
0answers
9 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
80 views

Custom role conflict with NextGen-Gallery

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
53 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
75 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
647 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
1answer
279 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
139 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
529 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
28 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
866 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
480 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
2answers
32 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
35 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
410 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
142 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
512 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
168 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
2answers
82 views

WordPress edit_user_profile_update update secondary role

I am trying to save secondary role field in user-edit.php which is independent of WP's main roles. I had no problem with saving other custom fields that are unique but for roles (wp_capabilities), it ...
0
votes
1answer
16 views

Letting users create a post that is a custom post type from a page

I'm trying to create a kind of "Request for Proposals" system for a blog that belongs to a client of mine. I'm not too sure how to go about this, but so far I've outlined this much.. I know there ...
0
votes
0answers
51 views

Permission to change post Author

I am trying to create a "limited admin" but I cannot manage to give this user rights to change the author of posts. The regular administrator can see the dropdown option to change author from both ...
0
votes
1answer
26 views

Is there a way for a limited user to just view the page of a post without being able to edit it?

I have multiple types of users using WordPress. One type is contributor. Right now they can't publish a post, it as to be the Admin or Editor. The problem I have is after the article is publish the ...
0
votes
1answer
209 views

gform_pre_render Dropdown populated with roles

I'm using gravity forms and trying to prepopulate a dropdown with a list of roles. This is what I have, but it's coming up with an error: add_filter("gform_pre_render", ...
0
votes
1answer
62 views

Is there a way of retrieving the core WP capabilities?

I've created a plugin that adds new capabilities & assigns them to both WP & core WP roles. I would like to remove these capabilities when the plugin is deactivated, but I need to check that ...
0
votes
0answers
145 views

WP User Frontend posts pending

I am using WP User Frontend, with a custom role and a custom post type: I have added my role like so: $wp_author_caps = array( 'delete_others_posts' => true, 'delete_pages' => true, ...
0
votes
0answers
39 views

Adding a new Custom Capability

(There are about 3-5 answers regarding this question that I can find and none give a solid answer - I want to do this without external plugins because this is for my own plugin) I am looking to add ...
0
votes
0answers
92 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 ...
0
votes
0answers
43 views

Create new capability but restrict to specific page

I am using a custom upload box to allow a subscriber to upload their own avatar. currently the upload is failing as subscribers do not have media upload permissions. I do not really want to enable ...
0
votes
0answers
44 views

How to make a plugin appear only to a certain role of user?

I'm using a plugin called "Team Result", to create team results and things like that. It appeared on the dashboard for admin(me). As you can see in this print ...
0
votes
1answer
153 views

Custom role, capabilities, and post type: preview button wrecks things

I'm using the Members plugin to manage capabilities of a custom role that will only be able to edit/publish a custom post type that I created in my functions.php file. After much work, I got this ...
0
votes
1answer
49 views

What capability is required to view posts, scheduled in the future, by someone else?

So, I'm trying to create a number of custom roles within my theme to meet with the custom requirements of the site. The first, and most simple, being 'external viewer' who I want to simply be able to ...
0
votes
1answer
89 views

Custom post type & role issues

I am having issues with using custom post types and custom user roles. I created a custom post type called Businesses. Then I created capabilities for users of a certain type to be able to add and ...