I’ve setup a WP MU site and I need to know how to sign up a user to a specific blog when they register. As it is now, if a visitor is visiting a specific site and they click the register button they are taken to the main network site and then they are given the option to register as a user or create their own blog.
I can create my own registration page but I’m not sure how to add that user to a specific site.
This is what I have so far:
$meta = apply_filters( 'add_signup_meta', array() );
$emailSent = wpmu_signup_user( $user_name, $user_email, $meta );
I think I found it,
http://codex.wordpress.org/Function_Reference/add_user_to_blog
This works if you do not have a confirmation email, but you then have to hook activation to use
add_user_to_blog
. WordPress will add a user to an existing blog (now known as a network site) on user activation if you provide a couple of meta data fields:See add_new_user_to_blog for more information (this is the function called through an action on user activation that assigns the user to a blog [network site] using the meta fields in the example above).