My goal was to use wp_insert_user() to create a user with “no role for this site”. For some notes on “no role for this site” see http://wordpress.org/support/topic/what-exactly-is-no-role-for-this-site-do#post-2177545
When using
$new_user = wp_insert_user( $userdata );
omitting the role parameter in the $userdata uses the default role set.
If you want “no role for this site”, set the role to an empty string.
// assign $userdata here as per the codes
// set role to an empty string
$userdata[‘role’] = ”;
$new_user = wp_insert_user( $userdata );
Leave a Reply