I am creating WordPress users from PHP code with the function wp_insert_user().
Basically, my code is:
$new_user = array(
"user_pass" => $pass,
"user_login" => $login,
"user_email" => $email,
"role" => 's2member_level1'
$insert_user = wp_insert_user($new_user);
How can I assign custom capabilities to that user by code?
Ps: the function add_cap() is not related to s2Member. I want to assign s2Member Custom Capabilities: