Try passing the value without serializing it manually, because WordPress will do it for you anyway:
add_user_meta( $user->id, 'orewpst_capabilities', array( 'author' => 1 ), true );
or
update_user_meta( $user->id, 'orewpst_capabilities', array( 'author' => 1 ) ); // it will create the meta data for you if it doesn't exist already.
The s:23
means that you stored a string with 23 chars.
Hope it helps!
Related Posts:
- wp_update_user not updating
- What is the difference between “create_users” and “add_users” capabilities?
- Let new user role to ‘edit_others_posts’ of other user role, not of its own type
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- Parent User and Child User – relate users
- How to create user specific pages (not user role!)?
- Can I Create a Second Admin Level User Role?
- Check what capabilitie(s) an action requires
- Why does user_can return false for a capability during plugin deactivation?
- Hide user fields based off capability
- Is there way to rename user role name without plugin?
- How to create a clone role in wordpress
- How to add a Capability to a User Role?
- How can I get a list of users by their role?
- How do I make a draft post accessible to everyone?
- Reset default roles and capabilities
- add_role() run only once?
- What do unfiltered_html and unfiltered_upload actually filter?
- Temporary capability for current_user_can()
- Create custom user role (client) that can create another custom user role (employee) of that client
- Allow roles below admin to add subscribers only
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- How to assign specific users the capability to edit specific pages / posts / custom post types
- How to get all capabilities of an existing user role
- Temporarily give ‘manage_options’ capability
- Is WordPress’ is_user_logged_in() secure?
- Hide specific admin users’ posts
- Allow authors to edit only certain users
- How to update role capabilities
- Temporarily disable user role login and replace with message
- How to loop through each user id?
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- Do custom user roles have any default capabilities?
- Ordering users of a specific role by last name
- How to programmatically add a user to a role?
- Allow user to Publish, but not Edit or Delete
- Email notification for editors only
- Shold I manually add ‘cap’ to admin role ?
- Allow users to publish child pages of the pages they have access to edit
- New Roles and Capabilities in WordPress
- Why is wp-login redirecting to the home page when I use this function?
- Is there a way to set the user Role based on email domain
- Allow contributor to view own scheduled post
- pre_get_posts Remove posts based on meta value with ‘post__not_in’
- How to prevent users with “edit_others_posts” capability from editing admin posts
- Author Role – Allow editing of Gallery images
- Access on specific pages in wordpress for a specific user
- How to get all users with Author role capabilities?
- How to ‘unpublish’ or ‘hide’ posts when user role changes?
- Capability for allowing user to post own comments without moderation
- How to check if a role has a specific capability
- Locking Down WordPress Application Password Permissions / Capabilities
- Prevent custom user role to add new pages
- Allow user to edit specific user with meta key using map_meta_cap
- How to remove sticky post capability for a specific user role?
- Hide Specific User Page
- how to assign more permission to wordpress author
- The delete_posts capability?
- Custom post type capabilities require “create_posts” to access the edit posts list page
- How to restrict access to specific pages on the back-end?
- Capabilites not working [closed]
- add_menu_page() for more than one user role
- WordPress missing user roles on local dev machine. Live site works fine
- Remove wordpress author’s capability to moderate comments on their own posts
- How do I remove the Other Roles field (from User Role Editor plugin) in wp-admin/user-new.php
- Can you set a role as author?
- How to redirect specific post type with user role
- Prevent Editors from Editing/Deleting Admin Accounts
- wordpress editor role remove all but ‘menus’ in appearance menu
- Where are the WordPress capabilities stored?
- How to restrict CPT post’s fronted view only for specific user roles?
- Assign second role to user
- Are User Levels Still Currently Used?
- Adding Capabilities to a WordPress User Account
- Adding an additional role to an Administrator
- Display user meta by different user role
- Custom user roles for access to specific parts of the site
- Pending status by default for a specific role
- How do I restrict user access to plugins?
- My subscriber has the “edit comment” capability but can’t edit comment
- Show metabox for a special role
- Restrict Access to Posts based on Custom User and Post Meta Data
- Assign a role to the user who registers on a form
- User Role Capabilities for WordPress Gutenberg Blocks
- Subscriber (with read permissions) cannot view Private posts
- How can I add a custom role capability to use in a custom plugin?
- bbPress plugin moderator roles
- Allowing user to edit posts based on the post status
- Assigning certain authors to specific editors
- Custom capabilities to add, edit, remove users of a particular role only?
- How to change user role using hook
- Where are $current_user->allcaps set?
- Stop users of author role from editing already pending posts
- add_role user capability not working
- Purpose of Adding Capability to Role But Not Grant?
- Restrict Access in Admin Panel
- Limit a user to have access to only specified pages?
- How can I promote a user to a network administrator?
- Reset Roles (or undo role changes on theme change)
- Create a User Role with permissions to only upload files to the media library?