0

I have two different WP sites set up in my multisite network.

The website #1 should act as the frontend of the multisite and website #2 is the members section.

If a user fills out the form on website #1 it is not needed that the user is registered for website #1, he should only be registered for website #2. Is there any function that I can use to do this?

I found:

  • register_new_user = It registers the user for website #1

  • add_user_to_blog = It adds the user from website #1 to website #2

  • wpmu_signup_user = It adds the user to the multisite admin panel.

There is not a function which is like register_new_user to only do this for website #2, is it?

Thanks!

  • Assuming you're using the built-in registration form, you should be able to hook into the user_register action, which receives the $user_id of the newly created user as an argument. Use get_current_blog_id() to check if the user was created on site #1 and, if so, use add_user_to_blog() and remove_user_from_blog() to "move" them to site #2. – karpstrucking Feb 13 '15 at 15:24
  • Hey, yep - I did it like that now and it works like a charm. However I thought there might be another function that does this automatically. Thanks! – Torben Feb 13 '15 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.