Advertisement
Guest User

Untitled

a guest
Sep 21st, 2011
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement