Stack Exchange Network

Stack Exchange network consists of 175 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.

2
votes
1answer
57 views

What's the difference between the capability remove_users and delete_users?

In the list of capabilities, I found there's both remove_users and delete_users. It's not clear to me what remove_users is supposed to do, the Codex documentation just says it was introduced in ...
0
votes
0answers
33 views

Notice: Undefined property: stdClass::$delete_posts with custom post type

I created a custom post type called gdpr_qao and I set 'capability_type' => array( 'gdpr_qao', 'gdpr_qsaos' ) in register_post_type arguments. On main custom post type screen I get: Notice: ...
0
votes
1answer
26 views

custom taxonomy not showing up after adding capabilities upon updating to WP 5.1.1

After updating to WP 5.1.1, my custom taxonomies do not show up under their assigned custom post types. When I comment out the custom capabilities that are attached to these custom taxonomies then ...
0
votes
1answer
13 views

read_post meta capability for anonymous users

read_post is a meta capability that can be used to check if a user can read a post. It can be used, for example, like this: if ( current_user_can('read_post', $post_ID) ) { // do something } No ...
1
vote
0answers
37 views

WooCommerce Customer Role Delete Custom Post Type

WooCommerce customers are creating custom posts using Gravity Forms and then the customer is assigned as the author of the post. The custom post type is set up using the CPT UI plugin. I have this bit ...
0
votes
0answers
22 views

Role and Capabilities: How do I allow user role to access theme options without enabling 'manage_options'?

I'd like to allow a certain user role to access the theme options only. When I tried this in functions.php, nothing happened: $limitedadmin = get_role('limitedadmin'); $limitedadmin->add_cap('...
0
votes
1answer
29 views

Email notification for editors only

I would like to send an email to all editors of my blog when a new article has been published. I found many plugins but I want to solve this problem without plugins. In addition, I found a tutorial to ...
0
votes
0answers
39 views

fine-grained capabilities for user related capabilities

When we want to adjust users capabilities, we can do so quite fine-grained. For example we can configure that a certain user can edit posts. But furthermore we can limit the capability of editing ...
1
vote
1answer
27 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. ...
0
votes
0answers
30 views

Plugin admin menu

I have a question currently I am using a table generator plugin, I want to allow users with the editor role to view this plugin menu on wp-admin. I understand manage_options capability ONLY Allows ...
0
votes
0answers
16 views

Multiple useres editing specified content

I work for a nonprofit with weekly courses for kids. Every week the course teachers update where and when next weeks course will be. We have about 10 courses every week. So the teachers need to be ...
0
votes
1answer
45 views

Custom Gutenberg Block and unfiltered_html capability

This is more a "am I understanding this right" kind of question: When I create a custum Gutenberg Block that should be used by an user of role Editor(which has no unfiltered_html capability on a ...
0
votes
0answers
13 views

save meta data of custom post type: WP_Error has no effect, even if insufficient capabilities

The function should give the user a feedback, if the data changes of the meta box of a CPT couldn't be saved. In the following code the function returns a WP_Error if the current_user doesn't have ...
0
votes
0answers
18 views

How do I change user capability for each plugin in WordPress

I have a website where people can register an account and add posts into it. Well I downloaded the plugin 'user role editor' and tried to edit the capabilities for subscribers to be able to upload ...
0
votes
0answers
26 views

Subscriber (with read permissions) cannot view Private posts

QUESTION: Why can't my Subscriber role (i.e. logged out user) view Private posts with the read_private_posts (or read_private_pages) capability extended to them? I use the Capability Manager Enhanced ...
0
votes
1answer
16 views

delete_published_posts does not work

I made a plugin with a custom post type calls "product". For some reasons, the administrator cannot move to trash post inside the list table. I know the capability to do that is ...
0
votes
0answers
7 views

Keep Page hierarchical order on Control Panel when I use 'remove_cap' 'edit_others_pages'

I'm admin user and just created several editor users who are 'NOT' allowed to edit other pages. Let me call them 'master editor','editor A' and 'editor B'. 'master editor' can edit top level parent ...
0
votes
2answers
27 views

Want to add post to user dashboard

I would like to add edit.php to user dashboard who registers as subscriber on a website. Code which i using is add_action( 'admin_menu', 'remove_menus' ); function remove_menus(){ if(!...
0
votes
3answers
40 views

Remove dashboard links from wordpress

I am trying to remove two links from users dashboard keeping it on admin but it goes off on both user and admin. One i need to remove from user dashboard and other is contact form plugin link contact....
0
votes
1answer
80 views

current_user_can capabilities in the admin not working as expected

I'm trying to block admin dashboard access using wp_redirect(). But the results of using current_user_can('edit_post') are unexpected. See my complete function below... /** * user constructor ...
0
votes
0answers
19 views

How to deny edit capability for pending custom post type?

So I have a custom post type called sale, a role called sales_manager and a custom capability called edit_pending_sales. I want to allow the Sales Manager to add new sales, which is be set to pending ...
0
votes
1answer
28 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
37 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
34 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
27 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) $...
0
votes
0answers
19 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
51 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
35 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
63 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
214 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
19 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
71 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
16 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
1answer
21 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
48 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( '...
8
votes
5answers
339 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
407 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
26 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
26 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
76 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
65 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
33 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
26 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
36 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
726 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
43 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
18 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
26 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
15 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 ...