Support » Plugin: Membership 2 » Force new users to be members

  • emptymind

    (@emptymind)


    I have free membership and a paid membership. I want all new users to the site to be a member and not be able to register without choosing a membership. Unchecking the ‘Anyone can register’ does not work so how do I do this?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • coderontheroad

    (@coderontheroad)

    Hey @emptymind ,

    Hope you’re well.

    Unfortunately, there is no way to force all users to register one of the membership, out of the box. But there is a couple of possibilities maybe that can solve your issue.

    For example, there is a Default Membership while creating a new membership. It will be default membership for all registered users if they didn’t choose any membership. Is that can solve the problem?

    Or maybe you can try this kind of code solution;

    add_action( 'ms_model_member_create_new_user', function( $member ){
    	$subsription = $member->add_membership( 5193 );
    } );

    You need to change 5193 with your desired membership id, and it will add all your new users to that membership.

    Lastly, maybe you can modify your register links on your website. Create different register pages for your memberships and use [ms-membership-register-user] shortcode. It has “membership_id” feature to assign this form a specific membership. So members that registered with that form will be added to that membership. You can check shortcodes at your website /wp-admin/admin.php?page=membership2-help&tab=shortcodes page.

    Cheers,
    Oguz

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.