Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
3 votes
2 answers
2k views

Redirect After Delete User in Backend

How do I redirect to a certain page after user deletion? For demonstration purpose, let's say I want to redirect to the dashboard on user subscriber deletion. This is what I have tried so far: ...
Giraldi's user avatar
  • 1,465
3 votes
1 answer
878 views

\WP_User Object | What's the Difference Between {caps} and {allcaps}?

Upon dumping the \WP_User object, I've noticed that there are two properties, which are directly related to capabilities for a particular user. $user_object->caps $user_object->allcaps I've ...
Michael Ecklund's user avatar
3 votes
2 answers
3k views

Does the "promote_users" capability allow someone to create a new admin account?

I've created a "Second Administrator" role to avoid the worst case scenario happening on my WordPress site when I have casual web development contractors. However if I give them the 'promote_users' ...
EnglishTeacherEric's user avatar
3 votes
4 answers
11k views

Capability to edit own posts and not others

What is the capability that let users to edit their own posts and not others? I am trying to enable the post authors to avail a plugin function only on the posts they own. The permission to access ...
Netizen's user avatar
  • 179
3 votes
1 answer
311 views

Change role after the user has read all the posts in a category

I'm creating a platform with "X" categories and "X" roles with the same name to each category. I would like to know how to change the user's role after they have read all the posts in a category. ...
Emanuele's user avatar
  • 143
3 votes
2 answers
3k 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
joe's user avatar
  • 31
3 votes
1 answer
637 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 ...
NetConstructor.com's user avatar
3 votes
1 answer
4k views

Allow users with Editor role to edit menus (without a plugin)

I came across the need to have a site Editor to edit menus. I found some answers that suggest the add_cap() approach, to add the edit_theme_options capability to Editor role. This should be done once ...
alvarogois's user avatar
3 votes
1 answer
2k views

Allowing Custom Capability to Manage Plugin Options

Question Is it possible to give a custom capability the ability to manage the options of specific plugins? Background I am developing a suite of plugins, a main one with some additional modules. ...
bicarlsen's user avatar
  • 141
3 votes
1 answer
2k views

Prevent user creating new users with specific roles

On a multisite installation I have created some custom roles. Some of them have the capabilities to create new users. I want to allow users to create new users only with allowed roles. One step is ...
Christopher's user avatar
3 votes
1 answer
6k views

Custom role based users are not able to access wp-admin

First of all I am a WordPress learner. So sorry if my code looks stupid! I have created a custom theme with a custom user role. I am not developing any plugin. In my fucntions.php file I have ...
Subrata Sarkar's user avatar
3 votes
3 answers
2k views

Do custom user roles have any default capabilities?

When adding a new user role with add_role(), are there any capabilities attributed to the role (or allowed by the role) by default? It is possible to create a role without defining any capabilities. ...
iyrin's user avatar
  • 1,796
3 votes
1 answer
2k views

How to enable the theme editor cap for an editor role?

I am trying to add/enable the theme editor for the editor role. The editor role by default doesn't have the option to manage theme options, so I addded this to functions.php: // get the the role ...
alex's user avatar
  • 1,122
3 votes
1 answer
3k views

Create user role restricted to specific CPT

I am trying to create a role that can create and submit to a CPT only. When I take away edit_post from the role, it revokes the ability to create and edit any of the assigned and registered CPTs as ...
Ollie's user avatar
  • 81
3 votes
1 answer
3k views

Filter available WooCommerce payment gateways by role [closed]

I know WooCommerce is not well-received here, because it's not directly related to WordPress, but as support on the WooCommerce forums is just that terrible and people here having proven they're ...
theHubi's user avatar
  • 89
3 votes
1 answer
6k views

How are roles stored in the database?

I know roles are defined http://codex.wordpress.org/Roles_and_Capabilities but how are they stored in the database? For instance, how is "Super Admin" stored i.e. 'super_admin'?
LouieV's user avatar
  • 149
3 votes
2 answers
2k views

Editor role cannot save custom theme options

There's a few questions on this site referencing this issue and I've read them and applied the proposed solutions to no avail. I've made a very simple theme options page that appears for the Editor ...
Ciaran Gaffey's user avatar
3 votes
3 answers
8k views

How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?

The default taxonomy, category. By default, only those with the edit_posts capability can assign categories during post creation/editing. I have a role with very limited capabilities. I want to let ...
sker's user avatar
  • 133
3 votes
2 answers
3k 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 ...
Josh's user avatar
  • 59
3 votes
3 answers
5k 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 ...
Justas Butkus's user avatar
3 votes
1 answer
3k views

How to assign an additional/extra/second user-role to multiple users (of a specific user-role)

I have 500 users with 50 of those users assigned to user-role XYZ. I'd like these 50 XYZ users to keep their current XYZ user-role but also be assigned another/additional/extra/second user-role ABC......
Pete's user avatar
  • 998
3 votes
1 answer
5k views

Disable plugins for a specific user role

I found this plugin and it disable plugins for users who are logged in, how can I change it to make disable plugins for contributor user role only? add_filter( 'option_active_plugins', '...
Cohagen's user avatar
  • 33
3 votes
2 answers
532 views

User profiles and object associations

I'm coming over from Drupal and I'm very used to the way Drupal handles users and objects (called nodes over there.) I have to learn how WordPress handles these same situations. Since we're going to ...
o_O's user avatar
  • 279
3 votes
1 answer
212 views

How to stop a user from updating the post date

I have a custom role, called "dealer". Once they have posted a new post, they cannot delete it. It's important they cannot update the date either, and I'm a little stuck on how to do this. It looks ...
Dan 's user avatar
  • 464
3 votes
1 answer
2k views

Modify custom Users Manage page

I'm trying to create a submenu page under 'Users' which is like the 'All Users' page but for listing users of specific roles only. Let's just call this submenu page 'Customer'. So far I managed to ...
Giraldi's user avatar
  • 1,465
3 votes
1 answer
372 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 ...
annabwashere's user avatar
3 votes
1 answer
657 views

Restrict Author to pick from media library, but not upload media

I have a multisite network where the super admins will be creating the individual sites. An important role we need to enable, for compliance reasons, is to restrict "Authors" to not be able to upload ...
chris_s's user avatar
  • 319
3 votes
2 answers
2k views

Can i copy administrator role to another user?

can i copy the role of administrator to another user and remove few capabilities not required ?. Basically, i want to have a user with restricted admin privileges.
Kid's user avatar
  • 51
3 votes
1 answer
485 views

Why does current_user_can('edit_posts') return true, but current_user_can('edit_post', $post->ID) returns false?

I have a plugin with a custom post type (with 'capability_type' => 'post') and a custom user role (test_user). When I check if a user is allowed to edit a post (of the CPT and which this user ...
jost21's user avatar
  • 249
3 votes
3 answers
1k views

How to allow "Add New" capability of CPT when links to its UI are placed as a submenu?

(Edit: going for the "Student" badge, and wondering if anyone out there could up vote this question?) I answered a question about capabilities, but now I'm in need of help on the subject. And after ...
Mort 1305's user avatar
  • 963
3 votes
2 answers
1k views

How to assign user a role if none is present when logging in

I currently have a front end part of a WP site that allows admins to create new users and assign then user roles from a drop down - that works perfectly. However, I am using a plugin to also ...
markb's user avatar
  • 299
3 votes
2 answers
2k views

how to add custom user capabilities using add_user_meta or something else?

i have two WordPress sites with SSO Configurations as described here but the plugin in the answer didn't work for me so i tried to write a code to add capabilities for second site users: $...
Mohammad Anbarestany's user avatar
3 votes
1 answer
2k views

Assign Subscriber capabilities to a custom user role

I am creating a custom user role (client) for the application I am building, and I want this role to have extremely limited capabilities. I am using the add_role( $role, $display_name, $capabilities )...
MarketHubb's user avatar
3 votes
1 answer
3k views

BuddyPress | Check if user is in current group [closed]

I'm developing a plugin for a website, which uses the Group Extension API to create a new "subpage" in the group's page, just like Home, Members... Here's the code: class BP_Suggest extends ...
Reuven Karasik's user avatar
3 votes
1 answer
4k views

Multiple authors for single post without plugin

I'm new to using WordPress and so, apologies in advance if this seems like a very basic question. I want to have multiple authors for single post. I had seen Co-Author. But I don't have to use plugin ...
Naeem's user avatar
  • 41
3 votes
2 answers
3k views

Assigning a category to a user role

I was looking for a plugin for this, but so far I cant find one that does what I want. I limited the user role capabilities with 'Restrict Capabilities'. But the authors still have to click the ...
Winstonn's user avatar
3 votes
1 answer
3k views

How to remove "Super Admin" from All Users for those that are not a "Super Admin"?

I would like to remove the filter at the top that says "Super Admin" for users that are not a "Super Admin". How do I go about doing this? This screenshot shows what I am talking about:
Matt's user avatar
  • 1,131
3 votes
1 answer
716 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 = ...
Pollux Khafra's user avatar
3 votes
1 answer
346 views

Customize the upload screen

I would need to simplify the "upload new image" interface for our Authors : basically, hide a few fields that will only confuse my wordpress "authors" (like the "Description" and "Alt" text inputs). ...
pixeline's user avatar
  • 2,857
3 votes
2 answers
722 views

User roles - enable custom posts disable posts

Im just wondering if its possible to create user role that allows to write/edit custom post type for example: Consultants, but not allow to write normal posts (used for as news for example). I know ...
kroma's user avatar
  • 33
3 votes
1 answer
1k views

Return ID of authors who have at least one post

I found a great piece of code here that returns the ID's of users by role. What I would like to do is modify it so it only returns the ID's of the users who have at least one post. I have tried to ...
Brooke.'s user avatar
  • 3,893
3 votes
1 answer
2k views

How can I prevent users from creating new categories?

I've set up some categories. I don't want users to add new ones. How can I do this?
bob's user avatar
  • 249
3 votes
1 answer
499 views

How to change role of all users with a specific role to another role?

what function can be used to change user role of all users who are currently assigned the role "Customer" to "Editor"? Basically I need to create a cron job doing this daily. I have figured out the ...
dc09's user avatar
  • 195
3 votes
1 answer
319 views

Add Capabilities to Custom Post Type after it has been created [duplicate]

I have a custom post type that is created by an external plugin. This plugin uses the capabilities associated with posts. I want to add my own custom capabilities to this post type. I have seen plenty ...
DigM's user avatar
  • 145
3 votes
1 answer
1k views

Remove upload_files capability from a role but allow role to manage an avatar image

I have a site with 1 admin, 11 editors, and 4000+ authors. I need to prevent the authors from adding media to the server and using up all the storage. Initially I tried function removemediabuttons(...
jerrygarciuh's user avatar
3 votes
1 answer
223 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 ...
John's user avatar
  • 161
3 votes
2 answers
2k views

Allow user to Publish, but not Edit or Delete

I saw post Allow Content Author to Publish, But Not Edit or Delete but is not the same I need and I cannot ask there because of reputation ¬¬ I need an user that can publish any user's post but can't ...
xotihcan's user avatar
3 votes
1 answer
171 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 ...
Aaron's user avatar
  • 325
3 votes
1 answer
2k views

Roles at registration (classipress)

I have a classipress site and want to have the user choose upon registering with the site if they are a teacher, or student. These will be different roles. I have been trying to get roles at ...
Andrew's user avatar
  • 31
3 votes
0 answers
58 views

Locking Down Wordpress Application Password Permissions / Capabilities

I am working on a Wordpress installation where we recently decoupled the frontend into a NextJS application that is no longer hosted on the same domain as the admin. We are accessing data etc through ...
some weird rando's user avatar

1 2 3
4
5
28