Skip to:
Content
Pages
Categories
Search
Top
Bottom

New users not being added to main blog


  • pixieblitz
    Participant

    @pixieblitz

    I have a setup with a few separate blogs for forums, store, etc. The member’s area is a separate blog, and I have added the following to bp-custom.php:
    define ( 'BP_ROOT_BLOG', '4' );

    Now, every new user that registers is automatically added to the “main” sites via a mu-plugin, with with code:

    function new_user_network_roles($user_id) {
    	add_user_to_blog('1', $user_id, 'sc-member-role');  // Add to main site
    	add_user_to_blog('2', $user_id, 'sc-member-role');  // Add to store
    	add_user_to_blog('3', $user_id, 'sc-member-role');  // Add to forums
    	add_user_to_blog('4', $user_id, 'sc-member-role');  // Add to members area
    }
    add_action( 'wpmu_new_user', 'new_user_network_roles');

    My problem is that the above configuration seems to work fine when a new user registers via the front-end registration form… but now I have a list of people I need to add, and adding them by hand as new users on the members blog only seems to auto-register them for all the specified blogs EXCEPT for the main one (ID=1).

    …Any ideas what’s going on?

  • The topic ‘New users not being added to main blog’ is closed to new replies.
Skip to toolbar