Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Redirect after “Join Group”

@danbp

Participant

@gabrieldespinoza,

this button has two functions: Join group or Leave group and is ajax dependent. So you cannot modify it easily. See /bp-legacy/budypress-functions.php:1157 how it’s done.

The best approach is to modify the landing page when you go on a group. By default, you go to the group home page.

Add this to your child-theme functions.php


function bpfr_custom_group_default_tab($default_tab){
	/**
	 * class_exists() is recommanded to avoid problems during updates 
	 * or when Groups Component is deactivated
	 */
	if ( class_exists( 'BP_Group_Extension' ) ) : // 
	
	$group=groups_get_current_group();//get the current group
	
	if(empty($group))
	return $default_tab;
	
	switch($group->slug){
		
		case 'XYZ': // group name (slug format)
		$default_tab='forum';
		break;
		
		case 'another-group': // another group 
		$default_tab='members'; // goes on a different tab
		break;
		
                // case etc, etc...

		default:		
		$default_tab='home';// the default landing tab
		break;
		
	}
	
	return $default_tab;
	
	endif; // class end
}
add_filter('bp_groups_default_extension','bpfr_custom_group_default_tab');

May this help ! 😉

Skip to toolbar