Reply To: Default Group Landing page – change to ‘Home’ rather than ‘Forum’
Hi @offthepage,
Put this into bp-custom.php or in your child theme functions.php
This is only an example ! Don’t forget to change group names and tabs name to your needs.
Just add/remove a case into the switch for each group you want to modify.
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 (slug format)
$default_tab='forum';
break;
case 'another-group':
$default_tab='members';
break;
case 'group-test':
$default_tab='admin';
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');