Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Auto join user to current group when using BuddyPress Ajax Registration plugin.
/**
* Auto join user to current group when using BuddyPress Ajax Registration plugin.
*
* @param int $user_id user id.
*/
function buddydev_auto_join_current_group_on_activation( $user_id ) {
if ( bp_is_group() ) {
groups_join_group( groups_get_current_group()->id, $user_id );
}
}
add_action( 'bp_core_activated_user', 'buddydev_auto_join_current_group_on_activation' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.