Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Redirect After “Join Group” Continued

@ma3ry

Participant

This is some code that I got from another page. Is there any chance that you could adapt it?

/* Redirect to Forum after Join 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 ‘social-group-547668396′: // group name (slug format)
$default_tab=’calendar’;
break;

case ‘husbands-out’: // another group
$default_tab=’forum’; // 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’);
Sat Jan 9 2016, 9:03:59 PM
(0) Reply

Add file

Skip to toolbar