PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Add user to Buddypress Group

  1. hazu
    Member

    I would like to add the functionality that whenever a user submits, s/he is added to the Buddypress groups that s/he selected in the form.

    I am a complete newbie at programming, so does someone have the code available that would do this?

    Posted 12 years ago on Monday January 16, 2012 | Permalink
  2. I do not know of any completed code for this; however, it appears that it would be fairly straight forward using the gform_user_registered hook and this function from BuddyPress: groups_join_group($group_id, $user_id).

    This is untested; however, it looks like you could pull the group ID from the $entry object (passed by gform_user_registered) and the pass that and the user ID (also passed by the gform_user_registered) and the user will be added to that group.

    Posted 12 years ago on Monday January 16, 2012 | Permalink
  3. @hazu
    There are Buddypress plugins that do this. Its called 'BuddyPress Mandatory Groups'.
    check it out: http://wordpress.org/extend/plugins/buddypress-mandatory-groups/

    Posted 12 years ago on Saturday March 10, 2012 | Permalink