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.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

How can Editor Role access and edit all Media

I am adding an Editor Role in WordPress which I want to have full access to the media files I being the administrator have uploaded. However, when I log in with the Editor's credentials (as an Editor),...
1
vote
1answer
21 views

Can't use /wp-json/wp/v2/plugins API endpoint even as administrator

Using Basic Authentication as an Administrator, I am getting an error code 401 Unauthorized : [rest_cannot_view_plugins] Sorry, you are not allowed to manage plugins for this site. error when I ...
0
votes
0answers
20 views

How to manage roles and capabilities [duplicate]

Roles and capabilities is easily the most confusing part of WordPress. Just when I think I have it sorted, I realise ...NO! I created a plugin and gave all the plugin admin pages in Dashboard: ...
3
votes
1answer
35 views

How to prevent users with “edit_others_posts” capability from editing admin posts

I have some posts that author is Administrator and some other posts that author is Editor After logging in as Editor, I can edit Administrator posts. I would like to prevent this. I find some ...
0
votes
1answer
20 views

How to restrict subscriber editing other posts but read specific posts in backend

I need to allow Subscribers to edit their posts (done) and read (see in backend) posts of specific author or with specific ID (to make copies of it). I found the code, but that's not enough: function ...
1
vote
1answer
18 views

What determines whether admin toolbar is shown to a logged-in user?

By default, Wordpress shows admin toolbar to Administrator, Editor, or Author but not to Subscriber or unauthenticated visitors. What determines whether admin toolbar is shown a logged-in user? I am ...
2
votes
1answer
18 views

Why do comment moderators need to have all create/edit/delete toboth posts and pages?

I struggled quitea bit to be able to set up my moderator account. Until I allowed all posts and pages capabilities and now the can finally moderate comments. I didn't deactivate one by one precisely ...
0
votes
0answers
17 views

map_meta_cap equivalent for register_taxonomy?

I recently added some custom post type user capabilities when using register_post_type() function. register_post_type('registration', [ 'capabilities' => [ 'edit_post' =...
1
vote
0answers
10 views

How to set individual capability of post type in individual category

I need to add a new post type "Story". Each of my users I will give them an individual role to edit/view their own "Story"(One user one role). User Role only gives ability to limit capabilities based ...
0
votes
0answers
22 views

hide pages for the page list for some user role

I need a way to make some pages not visible for 3 users role (editor, contributor, author) on the page list (edit.php?post_type=page). I think it is about permissions but i dont know how to do it. I ...
1
vote
2answers
62 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 ...
1
vote
1answer
38 views

How do you add customer capability after Woocommerce purchase?

Can I do something like this to add a capability after someone purchases a product in my child's function file? Please note, I'm using s2member and woocommerce, and I am a newbie. add_action( '...
0
votes
1answer
33 views

How do I code access to the built-in UI of a CPT when it's placed as submenu of another CPT that is protected by role?

I am toying around with WordPress capabilities, and having some difficulty understanding where I am going wrong. Right now, I have an admin menu that appears for all administrators with STUDENTS as a ...
0
votes
0answers
27 views

Author Error “Sorry, you are not allowed to access this page.”

I have a big problem, I try to login in WordPress as Author and I get a blank screen with this message "Sorry, you are not allowed to access this page". I am new to wordpress and i don't know how to ...
0
votes
1answer
34 views

Restrict Access to Posts based on Custom User and Post Meta Data

I have a custom Post Type called Club Pages, and a custom role called "Club Leader". Club Leaders currently can only read, modify, and delete all Club Pages posts. However, there are many different ...
0
votes
0answers
30 views

WP_Query and Meta Query filter custom post type by capability

I am currently using WP_Query for my custom filter function of a custom post type and I would like to filter this if a user has a capability. Using roles is also an option, but it would be easier if ...
0
votes
0answers
10 views

How to bulk remove capability from user role

I've got an issue where a custom user role 'member' has somehow ended up with the 'subscriber' capability. Example: Custom user role added via: add_role( 'member', 'Member', array( 'read' => true,...
0
votes
0answers
21 views

Delete admin edit/delete links in users list wordpress admin

Iam trying to disable the capability for and admin to edit or delete other admins in the WordPress users list. How can I do that without plugin ? Thanksenter image description here
0
votes
1answer
99 views

current_user_can() always returns true if user is super admin

current_user_can('custom_capability') always returns true for super admins even if the capability is explicitly denied as stated here. It does work with a normal admin account. I have added a custom ...
0
votes
2answers
59 views

Restrict specific private page to a specific user

Each user has a user meta called profile_url chosen during registration. After user creation, a page with that slug is created and made private (the author of the page is the admin). The user in his ...
0
votes
0answers
5 views

Create custom user role to view only 1 admin page

I've taken a look at the capabilities and roles, but it doesn't look like it's possible. But, maybe I'm wrong. I would like to create a user role, that when logged into wp_admin they can view a ...
0
votes
0answers
11 views

product sorting capability not visible on products page for shop manager

I have noticed that the capability to sort products manually is only visible with an administrator user role where when logged in as a shop manager. View screenshots attached, one is showing sorting ...
1
vote
1answer
33 views

Giving permission to anyone (non-users as well) with a password to edit a post, possible?

I would like to make possible to any visitors (non-users) to create a custom post from the WP frontend, then get a password in email which can let him/her edit the post if the proper password is given....
0
votes
0answers
23 views

Dynamic homepage depending on user role

Currently, I have 2 user roles: Supplier, and Researcher, where users must sign into the website before they can proceed. The goal of the site is to give each user access to a set of surveys that ...
0
votes
0answers
35 views

How to dynamically allow editor to access customizer on multisite?

Background For reasons I don't want to permanently grant the required capabilities to editor users to allow them to access the Customizer. So I'm using user_has_cap filter to set capabilities for ...
1
vote
1answer
286 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
24 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 ...
0
votes
1answer
44 views

WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?

WooCommerce has a special "account page" that customers get re-directed to instead of the WordPress admin backend. I'm trying to create a custom role that does NOT go to that page. When I clone "...
0
votes
1answer
20 views

What Capability is required to let a role RUN code in Edit Theme?

I am outsourcing some work and they are using the Theme Editor to add PHP to my site. For example, this bit of code https://docs.mylistingtheme.com/article/after-importing-listings-they-are-not-...
0
votes
1answer
39 views

What's the correct way to add capabilites to user roles?

A third-party plugin adds the capability 'edit_booked_appointments'. I'd like to assign this capability to the already existing user role 'editor'. I created the following function in my child theme: ...
0
votes
0answers
18 views

How to disable plugin capability : “create new category”

I tested that a capability can be disabled for any user role, but I found nothing to block the capability of a plugin. Is this possible? any help is greatly appreciated
0
votes
1answer
129 views

What is the name of the user capability to read a reusable block?

I have a custom post type and want a custom user role (I named it subscriber_modified) (based on subscriber) to also have the ability to view and add reusable blocks as they are editing the content of ...
1
vote
0answers
42 views

How to add an extra button on woocommerce shop page and use it to send the product info with image in a mail? [closed]

I want an extra button beside "add to cart" which will open a form with only email field and after submitting, it will share product name, image, info with branding and backlink to the webpage in a ...
0
votes
1answer
20 views

Create role that can edit some user details, but not the role

I want to create custom role ('sales') that can edit user profiles of 'subscribers' but can not change the role of that user. The user details that would be editable by the 'sales' role would be ...
0
votes
0answers
27 views

How can I add capability to multiple roles?

I have this variable: $wpll_accesslist = self::$options['wpll_settings']['wpll_accesslist']; and it's output is: Array ( [Author] => 1 [Contributor] => 1 [Shop_Manager] => 1 ...
2
votes
0answers
46 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 ...
0
votes
1answer
25 views

Allowing custom role user to edit post assigned to them but don't let them create new custom type post

Please don't mark this as already asked question as I have searched all the questions and none of them gives a clear answer. So I have created a custom role through Members plugin and I want the user ...
0
votes
1answer
47 views

WordPress custom post type capabilities issue

Using WP 5.2.4, I am registering my custom post type with this code: $args = array( 'labels' => $labels, 'public' => false, 'show_ui' => true, '...
0
votes
0answers
15 views

I need to forbid or deny a custom administrator role from creating other administrator user role

What can I add to this code? ... I need to forbid or deny this custom administrator role from creating other administrator user role? thank you add_action('init', 'cloneRole'); function cloneRole() {...
1
vote
1answer
163 views

Getting users by specific capability, not role

Is there a way to use the get_users() function, or maybe another way, to retrieve all users of a custom user capability? For example, I have given a select number of users the capability of '...
0
votes
1answer
24 views

Can't see post status drop down for custom post type

I have a custom post type called Group for that I have assigned all required capabilities to Admin. However, I am still not able to see Status (post status) dropdown on edit screen. Admin ...
1
vote
0answers
22 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 ...
0
votes
1answer
241 views

Custom Post Type Capabilities Singular/Plural

Just for clearance, if i add a custom post type with: register_post_type( 'event', array( 'labels' => array(…), 'capability_type' => ['event','events'], '...
0
votes
1answer
34 views

Want to know parameters that can be passed to user_can() for access control by user capabilities

I noticed someone else posted the use of user_can() in controlling access permission which appears very useful for an EC site: How to use current_user_can()? As I want to delicately control access ...
0
votes
0answers
80 views

Why is unfiltered_upload not working despite being enabled?

According to the Codex, all that's needed to enable the unfiltered_ upload capability - i.e. the ability to upload any filetypes to the Media Library rather than just the default whitelisted ones - is ...
0
votes
0answers
12 views

Create a Capability category to group a few custom Capabilities

The role editor has categories that allow easy grouping and finding of capabilities, how can I create a new one to add some of my own custom ones into?
2
votes
0answers
92 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 ...
0
votes
1answer
45 views

Allow specific user to edit a specific page

I've tried to make a script that only allows a specific user to edit a specific page but without any success. The idea behind, is that if a users username contains a specific word, they are allowed ...
1
vote
2answers
102 views

Prevent custom user role to add new pages

How can I prevent my custom user role to not be able to add new pages. I have this array of capabilities for my user role: $args = array( 'delete_others_pages' => false, '...
1
vote
1answer
163 views

Allow users to publish child pages of the pages they have access to edit

I have created a custom role called Custom Author. Users in this role can edit their own pages and add new pages. I would like to restrict new page creation and allow Custom Authors to create pages ...

1
2 3 4 5
10