Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [capabilities]

WordPress uses a concept of Roles, designed to give the site owner the ability to control what users can and cannot do within the site. Each role is allowed to perform a set of tasks called Capabilities.

0
votes
1answer
17 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?
0
votes
1answer
35 views

Best practices to handle multilpe roles and capabilities?

Consider a complex system made in WordPress with multiple roles and capabilities. Let's take a University website, for instance. A University website could have a capability to post news to the home, ...
1
vote
0answers
31 views

Best practices to assert current_user_can() with guests

In WordPress, a guest can do a lot of things, such as reading posts. However, this always returns false for guests: add_action('wp', function() { global $post; /** @var WP_Post_Type $pto */ ...
-1
votes
1answer
24 views

Enable plugins for a specific user role

I've created a new user role(based on shop manager) with user role editor, i need to show a custom plugin for this role. Thanks $user = wp_get_current_user(); if ( in_array( 'custom_role', (array) $...
-1
votes
0answers
9 views

Article is Password Protected

Password Protected article works on Computer and iPad but not on Mobile Phone. Can you advise please. Many thanks John Berry
0
votes
0answers
15 views

Restrict specific user to manages posts in specific category

I explain this with an example. In my blog I have 2 users: John Paul that write posts. Posts have 2 categories (to be precise, it's a custom taxonomy): Cats Dogs John manages the Cats section of ...
0
votes
1answer
33 views

Buddy Press restrict the capability to edit users

im trying to modify the Wordpress capability 'edit_users' for my plugin. In my case some User Roles should have the ability to modify some other Users with an specific Role BUT not every other Users. ...
0
votes
2answers
26 views

Cannot access wp-admin after installing SSL - user capabilities not being set

EDIT: Turns out the solution was to simply re-install wordpress (it was a new blog anyways). Still not sure what the issue really was but that solved it. I have tried every single fix on ...
0
votes
0answers
47 views

Allow author role to view others' draft posts

I'd like to allow users who are logged in and have the author role to be able to view drafts from other users, but not to edit them (the editors can do that). I've managed to allow these author users ...
0
votes
0answers
8 views

Publish_posts only if taxonomy term is checked

I have a custom user role that is not allowed to publish posts. I wonder if it would be possible to make an exception to this if any term of a specific taxonomy has been checked? So the user can only ...
0
votes
0answers
23 views

How to limit WordPress author role users to specific categories?

By default, users no matter which role they belong can publish posts to any or all of the categories. what I want is to limit users of specific role to specific categories. For example, I have books ...
0
votes
0answers
16 views

Not allow add New Page for role 'editor'

Sorry for my English first. What I want to achive is, that it is possible to change existing posts and not possible to add New Posts for the user role "Editor". Is it possible with wp caps or do I ...
0
votes
1answer
24 views

Read-Only custom post type

For the contact form of my own theme I have created a Custom Post Type in which the messages of the users are automatically stored. In the administration area the messages can be read similar to ...
0
votes
0answers
13 views

edit_others_posts capability not showing Author option

I have two custom roles on my site. Both of which I would like to be able to use to assign authors to a post. With both of my roles, I have 'edit_others_posts' added as a capability through the user ...
0
votes
0answers
19 views

Check what capabilitie(s) an action requires

I can check whether a user has a given capability or not with user_can() function, but how can I check what capability a certain action requires? For example, I'm using WP Job Manager plugin, this ...
0
votes
0answers
31 views

Toolset / User Role Editor: Custom Role unable to assign custom post type to taxonomy

I created custom type post with taxonomies using toolset and create custom roles for my event manager to handle the website using User Role Editor. I managed to create capabilities via function.php ...
0
votes
1answer
17 views

Disabling user capability to edit_posts or delete_posts in the front-end

I've created a post edit form in front-end of the site, this form is accessible on the front-end ONLY if the user is logged in. Now, for some reason, upon a certain condition is met, I want to DISABLE ...
0
votes
0answers
30 views

Can't remove a role's “edit_others_posts” capability for a custom post type

I am having trouble trying to remove a capability for a role on a custom post type. I have a CPT defined as function register_cpt() { $labels = array( 'name' => _x( '...
0
votes
0answers
22 views

Allow user to only assign terms to a CPT he can't edit

This is my first question over here, i hope i'll be posting in the right place and in the right way. THE PROBLEM I would like to allow a user to assign -via quick edit- custom taxonomy terms to a ...
8
votes
5answers
206 views

Allow Contributor to change the author of his own post?

Is it possible to let a contributor change the author of his own posts? I realize this will effectively lock them out of the post, that's what i want. I want them to be able to change the author once ...
1
vote
1answer
119 views

Permit users with author role to edit a custom post type

I have this already coded project which has a custom post type with a certain behavior: it is only a single post and admins/editors/authors can only edit its content. it's content is a custom data ...
0
votes
0answers
24 views

Allow user to have CRUD capability on a custom post type, but don't allow them to have CRUD on built-in “post”

I am having issue with my capability setup, so I created a custom post type named "Company", with the following args: 'capability_type' => array( 'company', 'companies' ), '...
1
vote
1answer
22 views

Able to edit custom post, but unable to create new custom post when within submenu. What capability is missing?

I'm encountering funny behaviour with a custom post of mine that I'm working with in a plugin of mine. Here are the arguments of the custom post: array( 'label' => [omitted], 'labels' =>...
0
votes
2answers
61 views

Admin cannot publish

When I logged in on my site this morning I noticed that my user can’t publish anything. I am administrator and the only user on the site. On Posts and Pages instead of “Publish” I have the “Submit ...
1
vote
0answers
31 views

Subsite access without being a member of the subsite in wp multisite network

How can a user access a subsite without being the member of that subsite in a wp multisite network? What I understand is that a user can not access a private post in a subsite if he is not the ...
0
votes
1answer
27 views

Not able to post data through wp-admin

I have a wordpress site wordpress version is "3.8.26". My php version is 7. when am adding new post to my site its not displaying "publish button" its showing "Submit for review". button And ...
1
vote
0answers
24 views

How can I add a custom role capability to use in a custom plugin?

I need to add custom capabilities to user roles, something along the lines of: $role->add_cap('xtc5000'); // 5000 can be different I need to use the 5000 value in another plugin for some specific ...
0
votes
1answer
24 views

How can I prevent certain custom roles from seeing other custom roles on the user list page?

So I am building a system with 3 different custom roles - Admins, Providers, and Users. Providers have access to users.php, or the list users page. However, they should not be able to see/edit/access ...
1
vote
1answer
254 views

add_menu_page() for more than one user role

If I add a custom page to the wordpress backend menu via add_menu_page('My Custom Page', 'My Custom page', 'editor', 'custom_page','add_custom_page','dashicons-admin-comments',8); only a user with ...
1
vote
0answers
32 views

bbPress plugin moderator roles

I want to add an override to the existing role of a bbPress moderator. I need: super admin assign forum to moderator and moderator access only that plugin. one forum to have multiple moderators one ...
0
votes
0answers
17 views

Wordpress limit already uploaded files access by capability

For quite some time now, I've been developing themes from scratch to private clients using wordpress, some woocommerce, etc. Now, I can't figure out how can one protect already uploaded files by ...
0
votes
0answers
23 views

How to add capabilities for editor type user to access admin section

How to add capabilities for editor type of the user. After login from admin side editor type of the user can access certain woocommerce product from admin dashboard. Only user can see some assign ...
0
votes
0answers
14 views

Limit users (by user role) to create a certain amount of pages

I asked this question before, but unfortunately I had no luck to get it working. Perhaps someone here can help me? The intention is that I can create users with a certain user role, these users then ...
0
votes
1answer
41 views

Wordpress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels

I have Wordpress website and has some user roles and I want to show related admin panels for their roles. I have checked few user role plugins but not found any solution. basically, We need to set ...
0
votes
1answer
46 views

WooThemes - Vendors / Bookings - Allow Vendors to manage resources

I am trying to bring new capabilities to the bookings plugin from WooThemes. While combining the bookings and the vendors plugins, vendor users aren't allowed to manage resources (resources are a ...
0
votes
1answer
73 views

edit_page or edit-pages for current_user_can()?

The more I read Wordpress Codex the more often I wonder if tutorials you can find on the net are actually correct. I've found several tutorials about creating metaboxes where user capabilities (when ...
0
votes
0answers
50 views

Assign Subscriber to Custom Post Type

With custom post_types, it's easy to say a user can edit their own or others if the post_type is assigned by author. What if I want to assign it using another field? Especially if I want to allow ...
0
votes
0answers
9 views

How to hide selective appearance options from Editors

I'm on WordPress 4.9.5 and I have successfully added special capabilities for editors to edit menus... if (!$roleEditor->has_cap( 'edit_theme_options' ) ) { $roleEditor->add_cap( '...
9
votes
4answers
206 views

Custom post type role permissions won't let me read

I cannot get it so that my user role for a supplier can read the shipments post type. It shows up in their menu but when you click on it you get you are not allowed to view this page error message. ...
0
votes
0answers
19 views

allow user to edit some posts based on user meta

I have users that work in teams on posts, and I want both users to be able to edit their collaborative posts, but not others' posts, only the posts they are connected to. Which for the post author is ...
0
votes
2answers
106 views

Allow contributor to view own scheduled post

As an admin, I can preview scheduled posts. In the post listing, there's a "preview" link which appears if you hover over the scheduled post title. As a contributor, I can preview a post if it is in ...
0
votes
1answer
49 views

Can I Create a Second Admin Level User Role?

I want to create a second User Role, which has the same priveleges like a Admin User Role. This way I can use the Adminimize plugin to disable some features there. I'm trying to have a User Account ...
0
votes
0answers
100 views

Restrict user role to only edit categories of published post, nothing else

I'm trying to figure out if it is possible to restrict the access of a specific user role in a way that would allow that role to be able to only edit certain aspects of a previously published post, ...
2
votes
1answer
601 views

How to check if a role has a specific capability

In a plugin, i create a dedicated user role along with some capabilities. These capabilities also need to be assigned to other roles, such as editor and admin. As the addition of roles and ...
0
votes
0answers
12 views

How to add an “add_cap” into a custom made html button?

I'm trying to create a membership website BUT the plugin I'm using does not let me create buttons to add custom capabilities to already registered users. Something like: On button click BUTTON ...
2
votes
2answers
245 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: $...
0
votes
0answers
16 views

Custom roles editing custom pages

I am designing an university website where different users may edit different pages. For example, professors must be able to edit pages related to their research, while administration personnel must ...
2
votes
1answer
411 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 ...
3
votes
1answer
100 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 ...
0
votes
0answers
135 views

add_cap() is not working correctly for me

I have 4 custom user roles in my project. And I have assigned custom capabilities to each user role. Students - student_cap Teacher - teacher_cap Local Admin - local_cap Master admin ...