Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to make free buddypress registrant level 1 instead of the default level 0 (subscriber) with s2member?


  • Josiah77
    Participant

    @josiah77

    I have a wordpress/buddypress/s2member install.

    What I need to know is how to make the bp registration form change from the default level 0 (subscriber) to automatically give them level 1 access without any payment.

    My whole training site is free. I have 5 s2member levels, 1,2,3,4,5. I do not use level 0 because the default subscriber roles don’t work properly for what I am doing.

    Again, I just need the buddy press form to give instant access to level 1 instead of level 0.

    Any thoughts on how to do this?
    I would imagine it is relatively straight forward, but I have scoured the forums here and found nothing on it.

    I could do it pretty easy in s2member, but buddypress only uses its registration form and doesn’t allow s2members, from what I understand…

    Anyone have any thoughts on this?

    I appreciate your wisdom, Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)

  • shanebp
    Moderator

    @shanebp

    Perhaps the 3rd comment here will solve your problem.


    Josiah77
    Participant

    @josiah77

    Where would I place said code snippet? I don’t have the plugin they are referring to.

    edited:

    /* Forces the default role of a new user to be set to "s2member Level 1" instead of "Subscriber" */
    add_filter("ws_plugin__s2member_force_default_role", "default_role",10,1);
    function default_role($role) {
    	$return = 's2member_level1';
    	return $return;
    }

    Can I place this in my bp code somewhere or something?


    shanebp
    Moderator

    @shanebp

    Please use the ‘code’ button when posting code in these forums.

    They explain exactly where to put it:

    You can overcome this problem by adding the following to your s2hacks.php file in your mu-plugins folder:

    You may have to create that folder and file. If you don’t know how, google it.


    Josiah77
    Participant

    @josiah77

    Nope. That Didn’t work.
    Any other ideas?

    Thanks in advance!


    shanebp
    Moderator

    @shanebp

    The name of the filter hook may have changed. Ask on the s2member forums.


    Josiah77
    Participant

    @josiah77

    From what I understand Buddypress has authority over s2member’s registration process, so even if I change things for s2member, buddypress won’t recognize it.

    IS there anything I can change in buddy press to make it work?

    Or

    Is there a way I can give the registration authority back to s2member?

    Thanks!


    shanebp
    Moderator

    @shanebp

    Try adding this to bp-custom.php:

    function josiah_set_user_role( $user_id, $user_login, $user_password, $user_email, $usermeta ) {
        wp_update_user( array( 'ID' => $user_id, 'role' => 's2member_level1' ) );
    }
    add_action( 'bp_core_signup_user', 'josiah_set_user_role', 15, 5 );
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to make free buddypress registrant level 1 instead of the default level 0 (subscriber) with s2member?’ is closed to new replies.
Skip to toolbar