View difference between Paste ID: j3n17CVe and
SHOW: | | - or go back to the newest paste.
1-
1+
function redirect_to_forum() {
2
	global $bp;
3
	
4
	$path = clean_url( $_SERVER['REQUEST_URI'] );
5
	
6
	$path = apply_filters( 'bp_uri', $path );
7
	
8
	if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false )
9
		bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
10
}
11
add_action( 'wp', 'redirect_to_forum' );