If you want to specifically deny a capability from a user (not a role), you need to use the add_cap()
method and specify that the $grant
parameter is false.
$user = new WP_User( 'Y' );
$user->add_cap( 'edit_plugins', false );
Related Posts:
- Plugin permissions for Editor role
- How to hide plugin options for editors via functions.php
- Defined user role to access plugin’s pages
- Want to add post to user dashboard
- How can I modify the Capability needed to access a plugin’s options?
- WordPress Capabilities: edit_user vs edit_users
- Allowing Custom Capability to Manage Plugin Options
- How can I let users to access plugin functions based on roles?
- Update User Role
- Getting user roles in plugin files
- Hook to plugins admin settings
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- How to create restrict content to users (by user, not by role)
- How to set add question capability for author role in wp pro quiz plugin
- Multisite – maximum number of users with specific role
- Understanding State in WordPress Multisites
- Add User Role: Pre-saved in User-Meta [SOLVED]
- Custom Login page with custom redirects for each user?
- Redirect admin 403 “Cheatin uh?” admin pages
- Mutliple users editing single document in wordspress
- How To Create A File Archive in WordPress?
- Completely remove ability to create users?
- Role based permission edit for plugins
- Creating teams of users in WordPress
- Plugin privelages for “editors”
- Adding plugin editing capability for Author
- See which user role / capability is needed to use a plugin
- how to create user profile pages and display them based on users roles
- Remove dashboard links from wordpress
- Disable plugin for administrator
- User / membership Plugin [closed]
- Why user profile update creates Additional Capabilities
- Run only on plug-in activation instead of wp_head
- Sync roles across several plugins
- How to give different user access to different people?
- How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
- How to disable plugin capability : “create new category”
- edit slider plugin capability for custom_role
- coauthors_plus_edit_authors to display metabox based on author caps
- After reading 3 story by user ask for subscription popup
- Allow editor user to full permission to access plugin settings
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- User updating their profile wipes my custom fields
- Allow a page to be edited by a specific custom role
- Comment restrictions Wodpress
- How to make this custom capability work? [duplicate]
- How to create different views for different user roles?
- How To Export User’s Custom Fields in CSV or XLSX
- Public WP website with one area just for members
- Get all user meta_keys and then group users by matching values
- fine-grained capabilities for user related capabilities
- Multiple useres editing specified content
- On button click, redirect users to registration page instead of another page
- How can I disable access to plugin settings in wp admin for other roles
- Searchable Semi Random Number Generator on User Profiles
- How do I run my custom function in my plugin when a wordpress user is deleted?
- How to show private pages based on a user’s role?
- Disabling user capability to edit_posts or delete_posts in the front-end
- How can I store user preferences in WordPress and retreive them later?
- Simulate Update User button click
- How do I restrict a second admin certain access?
- Update User Meta Via Ajax
- User Following System
- Echo custom admin field into a is_single()
- Hide top admin panel for non admin and non editors
- Restrict role to use a plugin
- How to see in Edit Comments if comment is from User and her Roles
- Add_Meta_box to custom page (formidable edit post)
- How can I create multiple different admin roles with their own capabilities
- Custom User Notice Upon Login
- Groups roles & capabilities
- A different role for each site in a multisite
- How can I save cookies to members
- Get content and send to 3rd party
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- Paid Memberships Pro, Display User Limit
- Overwrite user role
- Confusing problem with displaying message recipient metadata
- Every time I use wp_get_current_user() my plugin breaks
- How to enable Admins to see Plugins
- Admin page and admin menu. Permissions plugin
- How to order users alphabetically by name? in plugin UPME
- Users Ultra: Hide asterisk for required registration fields?
- Different role for free and pro users in wordpress without using bbpress
- Allow non-admin users to access plug-in
- Subscriber role – blank page
- Different email notifications (about pending posts) to different users
- Add a checkbox in plugin options page and make it actually work
- Embedding code snippets in posts with indentation
- Hide some portion on single.php base on author
- Plugins not activated after update?
- Custom User Role
- Getting 404 page not found error while trying to access add new plugin / themes
- Create a blank admin page from plugin
- How change menu for each user in plugin?
- How to set different users for different pages?
- admin panel save option with ajax
- Custom Form only for admin
- Convert usernames listed by the Groups plugin shortcode to displayed names?
- Displaying custom profile fields using Mingle Plugin