[Resolved] Can't change landing page for groups
-
WP 3.92
BP 2.1Hi, I’m trying to change the landing page for groups to redirect to Forums tab. I used this code, but it didn’t do a thing. I pasted it in functions.php of my child theme.
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');
Any suggestions of why is it not working?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Resolved] Can't change landing page for groups’ is closed to new replies.