Add user to group automatically
-
I have seen what is posted out there and everyone suggests working off of a few plugins developed years back. This is the code I constructed after looking at what they did, but it still doesn’t work.
I can pass the ID of the group a user selects through an entry, but still can’t get the auto join to group working. Any suggestions?
function ip_gravity_registration_group( $user_id, $feed, $entry ) { global $bp, $wpdb; $selected_team = rgar( $entry, '13' ); $group_id = $selected_team; $user_id = new WP_User( $user_id ); groups_join_group($group_id, $user_id); } add_action( 'gform_user_registered', 'ip_gravity_registration_group', 10, 4 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.