Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 21st, 2011  |  syntax: None  |  size: 0.82 KB  |  views: 109  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. function redirect_to_forum() {
  3.         global $bp;
  4.         $path = clean_url( $_SERVER['REQUEST_URI'] );
  5.         $path = apply_filters( 'bp_uri', $path );
  6.         if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false ) {
  7.                 if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
  8.                         bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
  9.                 }
  10.         }
  11. }
  12. add_action( 'wp', 'redirect_to_forum' );
  13.  
  14. function my_bp_groups_forum_first_tab() {
  15.         global $bp;
  16.         if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
  17.                 $bp->bp_options_nav['groups']['home']['position'] = '50';
  18.                 $bp->bp_options_nav['groups']['home']['name'] = 'Activity';
  19.         }
  20. }
  21. add_action('wp', 'my_bp_groups_forum_first_tab');
  22. ?>