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.

137 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
644 views

User-edit role setting distinct from wp_capabilities?

I need find out how $profileuser->roles is set. wp_capabilities can hold multiple roles, whereas user-edit role caters only for a single role. Under certain circumstances it is possible for there ...
3
votes
0answers
961 views

How to change menu page capability

Is it possible to change the capability set for a menu page, previously added with add_menu_page()? I have a third plugin installed, that set a menu page created with a 'manage_options' capability, ...
3
votes
2answers
916 views

Do not allow users to create new posts and pages

I'm defining a new user role called Proofreader and as the name says, users of this group should be able to read and also edit the posts and pages. But I do not want them to create new ones. With my ...
3
votes
2answers
938 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 ...
3
votes
1answer
1k views

Author Role - Allow editing of Gallery images

Is it possible to give the 'Author' role the capability of editing image titles and captions on post's they have created ? I have a number of users set to 'Author' , but when i've tested it's not ...
2
votes
0answers
45 views

In MultiSite, can some users automatically have Site Admin rights on all sites, without granting them Network Admin access?

We have some "content specialists" that we'd like to effectively grant Site Admin access to every site on our network automatically, but still don't want them to be able to access the network admin ...
2
votes
0answers
60 views

How can I control multiple editing of wordpress posts?

I am managing multiple authors blog, I have issues of editors taking over the stories that someone else is currently editing. The default wordpress warning will display but some of them ignore it and ...
2
votes
0answers
379 views

Custom Role for CPT Only

I have removed admin specific capabilities for the custom role however they can still delete admin published listings. I only want people with the custom role of submit_listing to be able to submit ...
2
votes
0answers
123 views

Add custom capabilities to existing custom post type

The only way I can find to associate post types with custom capabilities is during the register_post_type function. I'm looking to add a capability for a certain role (my_role) for a post type that ...
2
votes
0answers
61 views

How to restrict access to specific pages on the back-end?

Before anything... I understand how roles and capabilities work. And there are tons of plugins that help you manage those. Roles and capabilities can only be so specific though. Is there "wordpress ...
2
votes
2answers
3k views

Custom Post Type Capabilities — Enable Edit, Disable Create and Delete

I'm trying to configure capabilities for a custom post type. I want to enable editing, but disable creating and deleting. create_posts cannot be set to false unless delete_posts is also false, but it ...
2
votes
1answer
85 views

Users with custom roles can't read each other's comments

My site has a custom role ("coach") with its own set of capabilities (via map_meta_cap along with a few built-in roles). Each user is assigned a page on the site that they "own" and can edit (via a ...
2
votes
1answer
586 views

edit_comment capability for subscriber

I have given my site's subscriber role the following permissions (unserialized DB-query): [subscriber] => Array ( [name] => Reader [capabilities] => Array ( ...
2
votes
2answers
121 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 ...
2
votes
1answer
792 views

Allow contributors to moderate comments comments on posts they write

I run a multi-author wordpress site where we have a large number of contributors that can write articles, which are published after they are reviewed by an editor. (This is all standard wordpress ...
1
vote
1answer
20 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 ...
1
vote
1answer
15 views

Allow Contributor to edit published post and filter by page id

I'd like to give contributors permission to edit only some of their own published pages. I can use the following if I want to allow them to edit all of their published posts. How do I filter it ...
1
vote
0answers
20 views

Users and Multisite - Removing all user capabilities

Quick summary: I basically want to know if it would cause any issues if I remove user capabilities. When users register on a multisite, they get their 'capabilities' assigned to the site they ...
1
vote
2answers
23 views

Remove upload file types filter for admin

Does anyone know if there is a function to remove/bypass file types uploads filter (specifically for admins). I know there are plugins available but they often break or don't contain ALL the mime ...
1
vote
0answers
307 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: ...
1
vote
0answers
54 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 ...
1
vote
0answers
52 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
vote
1answer
31 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' =>...
1
vote
0answers
137 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 ...
1
vote
0answers
29 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 ...
1
vote
0answers
72 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 ...
1
vote
0answers
66 views

upload_files cap to not loggen in users - add_cap to not logged in users

When not logged in users upload files to the media endpoint, the return message is: "Sorry, you are not allowed to create posts as this user." I would like to allow not logged in users to be able to ...
1
vote
1answer
87 views

How to remove sticky post capability for a specific user role?

All is in the title. Does someone know a way to do that ? Thanks !
1
vote
0answers
42 views

Allowing user to edit posts based on the post status

I have Edit Flow and User Role Editor installed on my news site and I basically wanted to do a system where editors pitch ides worth writing about to contributors. So I would want my contributors to ...
1
vote
0answers
262 views

add_cap not working

Need to add a cap for the role editor, to grant them acess to a sub menu, but for some reason its not working. This is the sub-menu: public function submenu_apps_init() { $news_push = new ...
1
vote
1answer
36 views

Add capabilities via plugin for another plugin

I have a plugin I made and I need to add some capabilities for GravityView to the subscriber role in it in certain circumstances. I was trying to use user_has_cap filter to get it to work, and it ...
1
vote
0answers
122 views

Role capability issue

I have a custom sub menu item that has been setup for a long time and all of a sudden today one Role cannot see the item on the Tools menu. They can see a couple of other items on that same Tools menu ...
1
vote
1answer
36 views

Disable user from updating certain posts

I have a custom post type with a certain amount of posts. What I have to do is to disable users from editing/updating certain posts of that post type, but not all of them. I have to do that ...
1
vote
0answers
29 views

Custom capabilities to add, edit, remove users of a particular role only?

How to enable users of a particular role, called for example staff, to add, edit and even delete users - but of another particular role (here: clients) only? So far, when I add add_users, edit_users, ...
1
vote
1answer
940 views

How to allow Unfiltered HTML in a wordpress multisite install

I am trying to create a custom role in a wordpress multisite environment. This role is to have the same capabilities as an admin but also have the ability to commit unfiltered HTML like super admins. ...
1
vote
0answers
98 views

“Submit for review” for updates on existing posts

My custom user group for proofreaders has access to all our posts and pages but can't create or publish new ones. I also want disallow them to publish their changes. As far as I know, Wordpress has ...
1
vote
0answers
106 views

Access to CPT but not to 'post' post type

I have two custom post types for specific posts and I also use the built in post types. For one of my custom user roles I want to restrict the access to the two CPT only. But I am unable to do this. ...
1
vote
0answers
50 views

Allow add new post access to custom post but not wp post for some role

I am new to the WordPress. I have the woo-commerce plugin activated and administrative users can manage admin panel along with woo-commerce orders, coupons etc. I created new plugin which adds new ...
1
vote
1answer
279 views

Restricting Pages based on Hierarchy and User Role

I have an issue that has arisen and i'm looking for a solution. I have a website that has many sections of the site built within the page hierarchy. For example it looks something like this: Fruits -...
1
vote
2answers
2k views

Add a role and give admin priviledges

I am creating a Super Admin role in wordpress Roles. $capabilities=array(); add_role('Administrator', 'Administrator', $capabilities ); add_role('Super Admin', 'Super Admin', $capabilities) ); So ...
1
vote
1answer
520 views

How to restrict author to only access one custom post type ?

My installed Wordpress have 4 custom post type and 1 default post type. Basically what i want is that the author can also access particular one custom post type. Author must not see other post types.
1
vote
0answers
563 views

Cannot Create new Post within Custom Post Type

I have a custom post type registered and when registering I am using... if( !post_type_exists( 'email_template' ) ) { register_post_type( 'email_template', array( ...
1
vote
1answer
522 views

Admin custom option screen not saved unless user manage_options capability

I am running into exactly the problem described by this Trac: https://core.trac.wordpress.org/ticket/14365 I see that one of the devs added a Diff here: https://core.trac.wordpress.org/attachment/...
1
vote
0answers
437 views

Allow user to only access custom post type

I am starting to get comfortable with Custom Post Types, but I don´t get the capabilities for them right. I have something like this: // define capabilities... $capabilities_werden = array( '...
1
vote
0answers
123 views

Where are $current_user->allcaps set?

I recently found a problem with WP in which even the admin has no permission to get to anything on /wp-admin/. Oddly enough, when I compared the $current_user->allcaps to those on a normal site, I ...
1
vote
0answers
330 views

Usage of current_user_can()

I have a custom post type company, which has its own custom set of capabilities, including read_company, edit_companies, publish_companies, and delete_companies. In order to implement a role-based ...
1
vote
0answers
664 views

add_role user capability not working

I added a role this way: add_role( 'paar', __( 'Tanzpaar' ), array( 'add_users' => false, 'create_users' => false, 'delete_users' =&...
1
vote
0answers
273 views

“edit_published_posts” and “edit_other_post” issue

I need to modify a roles capabilities for post editing: User can modify his own post (publish status doesn't matter) User can modify others posts (only as long as they are not published) I played ...
1
vote
0answers
397 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 ...
1
vote
1answer
170 views

Restrict Capability of Administrator to Create, Edit and Delete Pages in Multisite

In my multisite installation, I need to restrict administrators from being able to create, edit, and delete pages. That is, I need all pages to be created/edited/deleted by superadmins while ...