Reply To: How can I redirect to Forum Group instead of Home Group from widgets?
Try this snippet, which let’s you determine wich tab you will see first when on a group.
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 'kill-bill': // group name (use slug format)
$default_tab='forum';
break;
case 'titanic':
$default_tab='members';
break;
default:
$default_tab='home';// the original default landing tab
break;
}
return $default_tab;
endif; // end if ( class_exists( 'BP_Group_Extension' ) )
}
add_filter('bp_groups_default_extension','bpfr_custom_group_default_tab');
Comment shane’s function before using this function.