Guest User

r-a-y

a guest
Jun 16th, 2010
3,457
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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' );
RAW Paste Data