
Untitled
By: a guest on
Jul 31st, 2012 | syntax:
None | size: 1.00 KB | hits: 14 | expires: Never
Buddypress - Groups navigation / redirect to forum (this again)
function redirect_to_forum() {
global $bp;
$path = clean_url( $_SERVER['REQUEST_URI'] );
$path = apply_filters( 'bp_uri', $path );
if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false )
bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
}
add_action( 'wp', 'redirect_to_forum' );
function redirect_to_forum() {
global $bp;
$path = clean_url( $_SERVER['REQUEST_URI'] );
$path = apply_filters( 'bp_uri', $path );
if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false )
bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . 'forum/' );
}
add_action( 'bp_init', 'redirect_to_forum' );
elseif ( bp_group_is_visible() ) :
locate_template( array( 'groups/single/** change this to any file within /single/ **' ), true );