Want more features on Pastebin? Sign Up, it's FREE!
Guest

r-a-y

By: a guest on Jun 16th, 2010  |  syntax: PHP  |  size: 0.37 KB  |  views: 2,259  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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' );
clone this paste RAW Paste Data