Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Thomas M
    Participant

    @webzunft

    I just had the same problem and wanted to clarify the solution, in case anyone else stumbles upon this.

    The option that Mathieu was pointing to is not in the BuddyPress option but in the WordPress options: Settings > Discussion > Avatar.
    I normally disable avarats on all sites and was also wondering why I didn’t have that option now on my new BP site.


    Thomas M
    Participant

    @webzunft

    The following code works for me:

    function automatic_group_membership( $user_id ) {
       if( ! $user_id ) { 
    	   return false;
       }
     
       groups_invite_user( array( 'user_id' => $user_id, 'group_id' => $group_id ) );
    }
    add_action( 'bp_core_activated_user', 'automatic_group_membership' );
    add_action( 'user_register', 'automatic_group_membership' );

    You need to replace $group_id with the ID of the group you want to assign users to.
    I have not tested the code when inviting members as a non-admin. That might be a limitation. There is an optional is_confirmed argument that can be submitted with groups_invite_users. Maybe, setting it to true helps in such cases.

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar