I previously had a WordPressMU install, but this is deprecated and I’m trying to find my way around multisite.

I need to programatically create a new user account for a particular site. wp_insert_user looks like it does everything except say which site the user is for (perhaps it takes this from the domain the request was sent to?).

It’s important that the created user is a member on one blog (site), but not the other(s).

2 Answers
2

You can use the add_user_to_blog function after creating the user.

$userid = 1;
$blogid = 5;
$role="administrator";
add_user_to_blog( $blogid, $userid, $role );

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *