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
14 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
19 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
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 ...
0
votes
1answer
19 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
19 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
20 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
13 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
34 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
38 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
16 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
17 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
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 ...
0
votes
1answer
23 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
27 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
13 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
54 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
16 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
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 ...
0
votes
1answer
68 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
23 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
37 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
11 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?
0
votes
0answers
54 views

Can't add categories or tags to a post as editor on Gutenberg editor

I've installed Members extension in order to restrict capabilites of the editor role. I want to allow the editor to create posts and add to it a category and/or a tag. I've set the capabilites as it ...
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 ...
0
votes
1answer
36 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
42 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
57 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 ...
0
votes
0answers
158 views

User Role Capabilities for WordPress Gutenberg Blocks

As I am switching from ACF to Gutenberg, I am looking for a possibilty to set specific capabilities for my users. In my common projects, my clients and content managers usually have "Editor"-Accounts ...
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 ...
0
votes
0answers
23 views

How to Allow Custom Created Roles to Access Specific Pages (or subdirectory)

This seems common but I can't seem to find a solution. Trying to avoid using a plugin because this feels straightforward. I'm looking to create three user types, I want each to be able to access ...
0
votes
2answers
75 views

Hide menu item based on user's custom capability

I need to show one item from menu only for users that are logged in and have certain custom capability set. Is it doable from theme functions.php or it needs a custom plugin? Note: I already use ...
0
votes
1answer
36 views

Custom roles and capabilities media not work right

Help with new user wordpress capabilities and roles custom. The media not work upload and display images in galery. image error: https://i.imgur.com/1bPbcAm.png code: if ( get_role('user_products')...
2
votes
1answer
70 views

How can I set status='publish' for all featured images?

Background: I've come accross this WP issue: https://core.trac.wordpress.org/ticket/41445 In short: when you make a request to a post over the REST API, if the featured image was originally uploaded ...
0
votes
0answers
56 views

How to give custom roles the capability to edit one Menu instead of every Menu

I would like to have a custom user role that can edit the Menu items under the Appearance tab. But I don't want my custom role to have the ability to edit every menu on my WordPress site. I only want ...
4
votes
1answer
201 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 ...
1
vote
0answers
309 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
377 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
63 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
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 ...
0
votes
0answers
40 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
52 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
47 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
348 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
36 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
127 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
41 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
140 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
33 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 ...

1 2 3 4 5 9