Reputation: 452
I'm having an issue importing users into a new multisite and reassigning them a customer role.
When using:
update_user_meta( $user->id, 'wp_2_capabilities', 'a:1:{s:8:"customer";b:1;}' );
the imported value ends up as
s:25:"a:1:{s:8:"customer";b:1;}";
in PhpMyAdmin.
As a result, the user is added to the multisite but has no role unless i change the value back to a:1:{s:8:"customer";b:1;}
Any help really appreciated.
Upvotes: 0
Views: 109
Reputation: 834
try this
update_user_meta( $user->id, 'wp_2_capabilities', maybe_unserialize(array('customer'=>1)) )
Upvotes: 1