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?
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?
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.
@hazu
There are Buddypress plugins that do this. Its called 'BuddyPress Mandatory Groups'.
check it out: http://wordpress.org/extend/plugins/buddypress-mandatory-groups/