Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*"
Favorites infavorites:mine
Status closed:yes
Types is:question
Exclude -[tag]
For more details on advanced search visit our help page
Results tagged with Search options answers only user 39152

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.

add_role() will not do anything if the role already exists, so it can't be used to modify capabilities. To modify capabilities use the add_cap() and remove_cap() method of the WP_Role object. You can … roles or capabilities are things that shouldn't be happening on every page load. If you want to modify an existing role, you'll need to do it just once. So that means you'll need to do it on theme or …
answered Dec 22 '17 by Jacob Peattie
Post types in WordPress have a list of capabilities that govern permissions surrounding them. These are: edit_post read_post delete_post edit_posts edit_others_posts publish_posts read_private_posts … capabilities that can be given in WordPress. Most of the time these have the exact same name. So the edit_posts capability of the post post type is edit_posts, while the edit_posts capability for the page …
answered Jul 12 by Jacob Peattie
The issue is that an empty return value from map_meta_cap will grant all users permission to do that thing, because that's essentially the same thing as saying "no capabilities are required to do … this". What you really want to do is just add edit_special_page to the existing list of required capabilities: add_filter( 'map_meta_cap', function( $caps, $cap, $user_id, $args ) { if ( 'edit_post …
answered Jul 15 by Jacob Peattie
Examining the comments for the properties in the WP_User class reveals that allcaps is: All capabilities the user has, including individual and role based. And caps is: The individual … capabilities the user has been given. But you probably shouldn't be using the properties directly. WP_User has a has_cap method that should be used instead, as it checks the appropriate properties and runs the result through the relevant filters. …
answered Jan 30 '18 by Jacob Peattie