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.
Related Posts:
- Are User Levels Still Currently Used?
- Can I Create a Second Admin Level User Role?
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- how do I add role and capability after I create a new user
- Editor can create any new user except administrator
- Remove Ability for Other Users to View Administrator in User List?
- Groups of capabilities: users with multiple roles?
- User-edit role setting distinct from wp_capabilities? [closed]
- How to let contributors to create a new revision(draft) editing their published posts
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Grouping users under parent user
- How to update user role without logout
- How to check user role without using current_user_can()
- Do not allow users to create new posts and pages
- How to enable the theme editor cap for an editor role?
- How to assign capabilities to user NOT to User Role
- How-to Delay The Capability To Publish Posts?
- Is there a simple way to manage capabilities per user?
- Get User Role by ID not working
- Getting users by specific capability, not role
- Remove Capabilities from WP admin for specific user role
- Updating wp_user_level on user update
- Add a role and give admin priviledges
- Where are $current_user->allcaps set?
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- What’s the correct way to add capabilites to user roles?
- Update user role for expired membership
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- Hook into add_user_role and update based on new and removed roles
- How to Moderate Edits to User Profiles?
- fine-grained capabilities for user related capabilities
- Disabling user capability to edit_posts or delete_posts in the front-end
- In admin manage users page, how can I stop users with certain privileges from editing users with other privileges?
- Groups roles & capabilities
- Subscriber role – blank page
- Creating Custom user type just like custom post
- current_user_can() returning true for capability when the user and role do not have the capability
- Find out if logged in user is not subscriber
- get_user_meta() doesn’t include user email?
- What the user_status column?
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- Hide Admin Menu for Specific User ID who has administrator Role
- How to display custom user meta from registration in backend?
- Allowing an email as the username?
- How we can get the user id by its display_name
- WP_User_Query with combined meta query – not working?
- How to programmatically add a user to a role?
- How to assign an additional/extra/second user-role to multiple users (of a specific user-role)
- How to stop a user from updating the post date
- how to add custom user capabilities using add_user_meta or something else?
- WordPress edit_user_profile_update update secondary role
- How to customize wp_signon()
- Is it possible to get a user with just the password field?
- How to get the Role Name of the current user? (WordPress)
- set_role has no effect
- How to add country drop down menu to the user profile?
- Users roles, make a page belonging to multiple users
- Add custom fields to the user profile
- How do I list in the backend all users that were assigned to a custom role?
- stop login if user_status equal zero
- How to add local users to wordpress without email password?
- WP User Query fails when searching meta queries and search columns
- Updating user meta
- create shortcode to list users with specific meta key value
- Error: How to allow the “contributor” to upload media in wordpress
- wordpress user roles are not working
- Restrict Access to Posts based on Custom User and Post Meta Data
- get_user_meta an ID for multiple functions
- What are some best practices for user exit strategy?
- Is there a way to identify a user in a custom REST API method? [duplicate]
- Problem with automatic role change through cron job
- Column Sorting Code on users.php
- Is possible to allow user to login with different role?
- Creating user without username and password
- Is this code true or not
- How do I let contributors edit their posts after being approved once?
- The Simple and Correct Way to Add User Meta
- Load user by specific role
- how to set default update_user_meta values wordpress
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- Get user by meta key – WP multi site
- Cannot Update user meta in custom field
- New User Save Filter
- Get users with different roles and call function on each of them (user_meta)
- Can I add a unique code for each user based on the location?
- Getting user data via ajax
- wp_get_current_user Not working
- Why does user_can return false for a capability during plugin deactivation?
- user and usermeta table not found
- Button for users to upgrade their user role + Button to show current user role!
- UserMeta Changes Meta Value for Post ID
- Restrict Access to the User Profile
- Username has been exposed
- How to get only 1 role from user
- User “none” role
- Limit user access to installing/configuring a plugin?
- Increase by one the user counter on specific role
- Show only users with the same role in Dashboard user list
- Add custom input field in new user page
- WordPress: New user role which is ONLY allowed to manage media