0

I've been searching for a while on the net but with no luck, how can I automatically register the user who registers to the network directly also in the site example.com/account/?

There are 3 sites installed in my WordPress multisite:

  1. example.com/
  2. example.com/account/
  3. example.com/go/

How can I automatically register the user only on the account site?

1 Answer 1

0

The following code works for me:

add_action( 'wpmu_activate_user', 'myplugin_registration_save', 10, 1 );
function myplugin_registration_save( $user_id ) {
    $blog_id = 13;
    add_user_to_blog($blog_id, $user_id, "subscriber");
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.