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

Capability for showing comments page in admin

I have created a new user role "advertiser" and added some capabilities. Advertiser has access to admin comments page /wp-admin/edit-comments.php and I need to know, which capability set to ...
0
votes
0answers
17 views

CPT requires manage_options and edit_posts for some reason

I made a CPT called sponsor. I set map_meta_cap to true and capability_type to sponsor. I created a custom role that has edit_sponsors, as well as all the other stems (delete, publish, etc., each with ...
0
votes
0answers
19 views

User role and capablities only for 1 plugin

What if i want a user called Marketing only to see the Slimstat plugin? The rest of the admin menu should be invisible for him. (for a external marketing agency that should see our stats but only our ...
1
vote
0answers
36 views

My subscriber has the “edit comment” capability but can't edit comment

When i use the wp_get_current_user function to display all informations about my user (subscriber), it shows that i can edit comment : I tried to display an edit comment button next to each comment ...
0
votes
0answers
34 views

adding new role with custom capability

I am trying to add new role with custom capability here is what I have done so far : add_role('event_manager',__( 'Event Manager'),array( 'read' => true, 'create_posts' =>...
0
votes
0answers
15 views

unfiltered_html issue with custom guttenberg block on multisite network

i have a custom guttenberg block that creates a grid of icon buttons using the package react-fa-icon-picker, it works fine if the user is a super-admin, but for editors and admins it doesn't work ...
0
votes
0answers
11 views

How can restrict certain users from delete a category but can view only in wordpress?

I would like to remove the capability of 'delete_term' for certain users. If can find the code which shows the 'delete' from 'wp-admin/includes/class-wp-terms-list-table.php' line number so where ...
0
votes
1answer
19 views

current_user_can() causing critical error

I am writing a function to add a link to the Media Library in the admin menu on front end: function add_media_link_to_admin_menu( $wp_admin_bar ) { // add Media Library to admin menu $...
0
votes
0answers
50 views

How to give plugin access to specific role(s)

How do I restrict plugin access to a specific user role? I wrote/installed a simple plugin that's listed in the left navbar in wp-admin. However, I'd like to only have it show for specific roles. I ...
0
votes
0answers
12 views

How do I add a custom capability to a user role that would allow the user to add/remove specific users and not the entire list of users?

This may be slightly confusing but I will do my best to explain. I am trying to create a capability that would allow a user to add users to our site. They would be able to view and delete these users ...
1
vote
0answers
30 views

Custom post type capabilities require “create_posts” to access the edit posts list page

I have a custom post type and a custom user role that I want to be able to do everything but delete and create this post type. However, this user role can't view the dashboard's list of posts for ...
0
votes
0answers
21 views

Allow contributor user role to perform copy operation PHP

I have posted the issue on Stack Overflow but didn't get any solution. So now I am posting here. I want to allow contributor user role can copy file from one location to another location. I am using ...
0
votes
1answer
13 views

Allow comments only for custom post type

I want to allow comments only for custom post types but not for normal posts or pages. What would be the best way to do that? I can think of one way that is a bit ugly. One would be to remove the ...
0
votes
1answer
25 views

How to make WordPress 'editor' role to list/view/add/edit users only with the role 'author'?

I have added some extra capabilities to the existing 'editor' role in wordpress with: function add_uedit_caps() { $role = get_role('editor'); $role->add_cap('create_users'); $role->...
0
votes
0answers
31 views

current_user_can( 'edit_user' ) does not work

I don´t clearly understand why this code does not work : //Front-end profile page global $current_user; if ( current_user_can( 'edit_user') ) { ... } $current_user output : ["allcaps"]=> ...
0
votes
1answer
16 views

Restricting shortcode for users

anyway to block any user /role(except the admin) to use shortcode? i want to keep some specific shortcode secret. if somehow users come to know, they cant use it. if only admin writes the shortcode it ...
1
vote
0answers
18 views

Adding user capabilities for a custom taxonomy of a custom post type for a custom user

I have a custom user role I've set up that has access only to 1 specific custom post type and nothing else ( no access to post, pages etc. ). I've got it working however I can't seem to figure out how ...
0
votes
0answers
19 views

How to only display all posts to a custom User Role?

I have a custom user role and I want to display all custom website posts to them, without letting them edit/delete them. Right now the custom post doesn't show up in their dashboard. I know it will ...
1
vote
1answer
29 views

Why is my Custom Post Type not showing up after adding capabilities?

I'm trying to add a custom post types with capabilities, so a custom user role can do certain things with them. Eventually the custom role is a Client, and the post a Website, and I want clients to be ...
0
votes
0answers
27 views

option_page_capability_ add_filter is not working

I would like to give permission to editor to save the option field I have created (working fine with administrator). I read on several forums that the add_filter( 'option_page_capability_ is the ...
0
votes
0answers
11 views

Media not loading for some custom roles

I can't see my media library for my custom role "restricted user". The capabilities works well for the rest, but I can't see any image in my library (with this role only). The ajax loading ...
1
vote
2answers
56 views

Show metabox for a special role

I have special roles on my site. I use easy digital download. My user has access to the download page. I want the metabox not to see the number of sales. Can I hide this metabox for this role or user? ...
0
votes
0answers
26 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),...
2
votes
1answer
587 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
59 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
26 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
20 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
24 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
23 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
11 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
68 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 ...
2
votes
2answers
143 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
56 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
101 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
37 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
142 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
39 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
12 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
25 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
190 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
290 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
7 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 ...
1
vote
1answer
34 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....
1
vote
1answer
1k 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
36 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
57 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
26 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
75 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
20 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

1
2 3 4 5
10