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
- How to check if user is in back end?
- How do i know the current post type when on post.php in admin?
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- Deactivate plugin for a specific user group
- How to let contributors to create a new revision(draft) editing their published posts
- Keep one user logged for a year?
- How to check user role without using current_user_can()
- How to add a help tab to all admin pages – including plugin pages
- Custom plugin settings: clicking “save changes” does not display success message
- How to assign capabilities to user NOT to User Role
- Prevent user creating new users with specific roles
- Disable plugins for a specific user role
- Customize Admin Users Screen based on Role
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- WordPress roles – Protect administrator role
- What’s the point of using WordPress’s built in admin-ajax.php?
- How to set CORS header?
- Allow Facebook to preview posts before published
- How to expire all wordpress user passwords instantly?
- Keep user’s privileges on accessing contents in JSON response
- How do I remove the entire left nav bar in admin for certain level users?
- How create a role with admin capability less 1 or 2?
- Reset WordPress website
- Set of plugins to control the Admin UI
- How to transfer all user data between wordpress installations?
- Auto delete WordPress users according to time
- Which plugin will let me decide what users have access to on their side bar in wp-admin?
- Redirection of users away from wp-admin (but not administrators)
- How can I copy all users to newly created site on a multisite network in WordPress?
- Plugin dependencies: show notice like theme plugins dependencies
- Enable users to change change and add taxonomies of posts
- Disable user from updating certain posts
- Where are $current_user->allcaps set?
- Unable to delete custom post types, confusion around capabilities
- Add sub menu page in your plugin
- What’s causing this error? “Warning: Invalid argument”
- How to create multiple users at once?
- Shortcode to update user meta
- WordPress Admin Menu defining function is seperate file
- how can I query all wordpress users of a blog
- Add Content to Content()
- in source code but I can’t find it in files or plugins
- Remove value from array within post meta ajax admin
- Add logo to admin menu in my plugin
- how do I add role and capability after I create a new user
- Auto populate a user custom field from another user custom field
- Admin Custom Plugin List Files in admin Table
- Allow a page to be edited by a specific custom role
- How to create different views for different user roles?
- How To Export User’s Custom Fields in CSV or XLSX
- Get all user meta_keys and then group users by matching values
- fine-grained capabilities for user related capabilities
- 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 to show private pages based on a user’s role?
- How can I store user preferences in WordPress and retreive them later?
- Paid Memberships Pro, Display User Limit
- admin panel save option with ajax
- What would cause edit buttons for plugins to disappear?
- registration plugin [closed]
- How can I hide Dashboard notifications for just one particular plugin?