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 add a Capability to a User Role?
- How can I get a list of users by their role?
- Reset default roles and capabilities
- What do unfiltered_html and unfiltered_upload actually filter?
- Temporary capability for current_user_can()
- 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
- Hide specific admin users’ posts
- How to update role capabilities
- How to loop through each user id?
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- Ordering users of a specific role by last name
- Allow user to Publish, but not Edit or Delete
- Shold I manually add ‘cap’ to admin role ?
- New Roles and Capabilities in WordPress
- Why is wp-login redirecting to the home page when I use this function?
- Allow contributor to view own scheduled post
- Author Role – Allow editing of Gallery images
- How to ‘unpublish’ or ‘hide’ posts when user role changes?
- Capability for allowing user to post own comments without moderation
- 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
- 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?
- 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
- Adding Capabilities to a WordPress User Account
- Adding an additional role to an Administrator
- Custom user roles for access to specific parts of the site
- My subscriber has the “edit comment” capability but can’t edit comment
- Assign a role to the user who registers on a form
- 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
- How to change user role using hook
- Where are $current_user->allcaps set?
- Purpose of Adding Capability to Role But Not Grant?
- Create a User Role with permissions to only upload files to the media library?
- How to get a users list by who created them?
- User restricted only show posts assigned to current user
- Custom Capabilities for CPT and Problem with current_user_can()
- Custom wordpress admin page/url “You do not have sufficient permissions to access this page.”
- Hiding custom theme functionality using capabilities
- user_can() not working for comment authors
- Which capabilities are available in Gravity Forms Salesforce plugin? [closed]
- How to write conditions based on user capabilities not on user role?
- Hide front-end from every logged out user and redirect them to the default login page
- What Capability is required to let a role RUN code in Edit Theme?
- How to restrict an admin page, if the user is not superadmin?
- Problems using ‘add_role’
- Redirect admin 403 “Cheatin uh?” admin pages
- Let editors view post in admin but not be able to perform a save/edit
- Capabilities don’t add
- how do I add role and capability after I create a new user
- Need to block user role from accessing bbPress all together
- How to create a front facing user sign up, log in and profile pages like FoodGawker.Com [closed]
- Why can my subscribers create new posts for review?
- Disabled delete_others_posts if post is from admin
- Adding all custom capabilities to admin
- User role and capablities only for 1 plugin
- How to give plugin access to specific role(s)
- Update user role for expired membership
- Is there a way to allow users with “Subscriber” user role to access media library in backend and frontend
- current_user_can( ‘edit_user’ ) does not work
- How to restrict subscriber editing other posts but read specific posts in backend
- Saving user meta “member_id” based on user role
- grant multiple roles access to specific admin menu item
- How can I add capability to multiple roles?
- Role and Capabilities: How do I allow user role to access theme options without enabling ‘manage_options’?
- Best practices to handle multilpe roles and capabilities?
- Force “submit for review” on update?
- Is it possible to restrict a specific user to edit a specific custom post.
- Need to create admin user without capability to create user
- How do I make a draft post accessible to everyone?
- Assign specific editor with custom user meta “A” to all authors with custom user meta “A” and exclude all other author access
- Grant access to admin menu?