i have two WordPress sites with SSO Configurations as described here but the plugin in the answer didn't work for me so i tried to write a code to add capabilities for second site users:
$wp_user_query = new WP_User_Query(array('role' => 'author')); $users = $wp_user_query->get_results(); if (!empty($users)) { foreach ($users as $user) { add_user_meta( $user->id, 'orewpst_capabilities', "a:1:{s:6:'author';b:1;}", true ); add_user_meta( $user->id, 'orewpst_user_level', '2', true ); } }
the problem is the output result for "a:1:{s:6:'author';b:1;}"
is s:23:"a:1:{s:6:'author';b:1;}"
i don't know what "s:23" means and why it appears in database!
update: I want the string "a:1:{s:6:'author';b:1;}"
to store in database with out any change! but somehow my code adds an "s:23:" before it.