Advertisement
Guest User

Untitled

a guest
Sep 24th, 2011
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2. function redirect_group_home() {
  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[$bp->groups->current_group->slug]['home']['slug'] ) === false ) {
  7. if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
  8. bp_core_redirect( $path . 'forum/' );
  9. }
  10. }
  11. }
  12. function move_group_activity_tab() {
  13. global $bp;
  14. if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) {
  15. unset($bp->bp_options_nav[$bp->groups->current_group->slug]['home']);
  16. }
  17. }
  18. add_action('bp_init', 'redirect_group_home' );
  19. add_action('bp_init', 'move_group_activity_tab');
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement