Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey there,

    Each site should have their own membership settings, unless you’re also using the PMPro Network Subsite Helper addon, which makes all of the subsites use the main site’s settings. If you have that activated, deactivate it and your subsites should use their own membership settings.

    Thanks,
    Jess

    I too have had this issue. Hopefully I can explain what’s going on.

    Network Helper is active, on a Multisite install. When a user registers, they are added as a user on both the main site and their new site.

    What we would like to happen is for the user to only be registered on their new site, and not on the main site. They need editing permissions on their site, but not on our main site.

    Thread Starter beatstore

    (@beatstore)

    Thanks for clarifying growsocial. It’s taken a minute but I ended up writing a script that solves the problem . I’ll post it in a moment here.

    Thread Starter beatstore

    (@beatstore)

    I put this into my own plugin, but I guess it could be used in the functions.php of your active theme , too. Just wanted mine to be part of the site regardless of what the active theme is.

    function yourwebsiteprefix_remove_users_from_mainblog() {
    	/*
    	First establish the current user ID and the value of constant BLOG_ID_CURRENT_SITE
    	*/
    	$user_id = get_current_user_id();
    	$blog_id = BLOG_ID_CURRENT_SITE;
    
    	//we dont want super admins
    	if ( !is_super_admin() ) {
    
    		//check to see if the current user is a member of the Main blog.
    		if ( is_user_member_of_blog( $user_id, $blog_id ) ) {
    
    			//Remove them from the main blog
    			remove_user_from_blog( $user_id, $blog_id );
    
    			// Redirect user to their dashboard
    			wp_redirect( admin_url() );
    		}
    	}
    }
    add_action('wpmu_new_blog', 'yourwebsiteprefix_remove_users_from_mainblog');
    Plugin Author Jason Coleman

    (@strangerstudios)

    The code posted will work, but also will keep people from getting to the membership account page to upgrade/cancel/etc. However, this might be okay based on what other kinds of customizations you are doing.

    Users have to be users of the “main” site because that is where their membership is tracked. You can maybe use a different subsite for your checkouts (member.site.com or account.site.com) if you don’t want them to be “subscriber” users on the main site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Users only members of their new subsite Network Site Helper’ is closed to new replies.