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.
512
questions
2
votes
2
answers
420
views
Remove or disable Appearance > Patterns
Not sure quite when, but a recent WordPress release has added a new WP Admin link under Appearance for Patterns:
My themes don't use Gutenberg, and I've disabled it. But the Patterns screen is still ...
0
votes
2
answers
46
views
Hide comments from admin comments.php that user can't edit or manage
I am running into a problem in that I have users that can edit comments, but only those placed onto their own posts. Which is what I want. Unfortunately the edit-comments.php page shows all comments. ...
1
vote
0
answers
30
views
Only allow users (that are not admins) to edit a specific post
I am using a ACF field on the user profile.php to assign a post id to a user. The users need to be able to receive the capability to edit this post, but only this post. They should not be allowed to ...
3
votes
0
answers
13
views
Add/remove capability for blocks theme nav menu
I'm building a wp blocks theme for in-house websites with controlled branding. This theme will be rolled out to hundreds of websites.
I want to create a second level administrator role and remove ...
0
votes
1
answer
29
views
Allowing a CPT post to be edited by a single user role
I am in the process of creating a form for a user to fill out to create a listing request which creates a CPT post and user record.
In this process, I want to copy the subscriber role, rename it '...
1
vote
0
answers
13
views
Easiest way to create Reviewer Role: Can preview Drafts (and Private Pages) but not Edit them
This seems a bit of a hole in Wordpress Roles. I have a site with many cooks (Editors). I would like to give some of them read-only access to Draft and Private materials.
This post goes a little way; ...
0
votes
2
answers
39
views
Non-super-admin users cannot access CPT even though I have explicitly added the capabilities to the user role
I've defined a CPT and any non-super admin user on any subsite cannot access it. I cannot figure out what is wrong with my code.
CPT Definition:
// Opportunities
register_post_type(
'...
0
votes
0
answers
10
views
How to create a WP Capability that limits editing to posts in a certain category?
Is there a way to create a WP User Capability that only allows editing of posts in a certain category and no other posts?
There are plugins that do this, but wondering how to do it in PHP code. It ...
1
vote
0
answers
98
views
How can I get all capabilities for a particular user?
I am trying to get an array of all caps for a given user. But the method get_role_caps() only returns the custom capabilities assigned to the user. The array does not contain the caps from the default ...
0
votes
0
answers
24
views
coauthors_plus_edit_authors to display metabox based on author caps
Need to display the coauthorplus metabox with author capabilities.
On the documentation of the plugin they say its only with super admin and editor that the metabox is available.
Any idea to add a ...
0
votes
1
answer
40
views
Capability needed for user to have an author page?
Only those that are authors have an author page.
But thing is my client wants to have users that have a page, but that do not have author capabilities (they can modify the info on it but not create ...
0
votes
0
answers
18
views
How to allow subscribers to create post of a new custom post type
I am working on a plugin which adds a new custom post type and I want all users to be able to create new posts of this type. Here is what I've got at the moment:
$labels = array(
'name' ...
0
votes
1
answer
220
views
How can I display customizer's "Additional CSS" to administrators and editors (in multisite)?
In my multi-site WordPress, administrators and editors don't see the Additional CSS section in the customizer. I would like them to have access to that panel. Only super-admins can see the additional ...
0
votes
1
answer
93
views
Why is user_can_access_admin_page() an undefined function?
According to WordPress Developer Resources, the user_can_access_admin_page() function is still active and valid...
https://developer.wordpress.org/reference/functions/user_can_access_admin_page/
...
0
votes
1
answer
78
views
How to correctly override a filter?
function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
// Bail if not checking the 'bp_moderate' cap.
if ( 'bp_moderate' !== $cap ) {
...