Skip to:
Content
Pages
Categories
Search
Top
Bottom

Join Group by Key


  • Nomi
    Participant

    @naumanahmed19

    I want to add allow user to join groups by a enrollment key. Can any one give me an idea how to do it?
    or is there any plugin?

Viewing 1 replies (of 1 total)

  • Nomi
    Participant

    @naumanahmed19

    Okay I have created a new enrollment key option in request membership form.

    The problem is that where should I add check if enrollment key is true that user auto join group without asking from admin.

    I have some code for auto join i think it will work but where should I add it.

    if($enrollment_key == 'xxx'){
        if ( bp_groups_auto_join() && bp_current_user_can( 'bp_moderate' ) && 'key' $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(),$bp->groups->current_group->id ) ) {
    	groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
    	}
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Join Group by Key’ is closed to new replies.
Skip to toolbar