Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Changing Group tab display defaults


Andrew Tegenkamp
Participant

@andrewteg

@r-a-y, thanks for this as it works great! To @Robcwright and others interested, I know it’s an old thread but have found this change will make it only do this for public groups or groups where you are a member and private groups will no longer redirect but keep the default setup. I put both in bp-custom.php and that seems to work great with a variety of child themes. If you want any other modifications for other cases I haven’t tried, just mention me in the reply and I’ll take a look when I can.

`
function redirect_to_forum() {
global $bp;
$path = clean_url( $_SERVER );
$path = apply_filters( ‘bp_uri’, $path );
if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav ) === false ) {
if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == ‘public’) {
bp_core_redirect( $path . $bp->bp_options_nav . ‘/’ );
}
}
}
add_action( ‘wp’, ‘redirect_to_forum’ );

function my_bp_groups_forum_first_tab() {
global $bp;
if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == ‘public’) {
$bp->bp_options_nav = ’50’;
$bp->bp_options_nav = ‘Activity’;
}
}
add_action(‘wp’, ‘my_bp_groups_forum_first_tab’);
`

Skip to toolbar