SHARE
TWEET

Untitled

a guest Sep 21st, 2011 122 Never
  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. ?>
RAW Paste Data
Top