Rename Labels for Buddypress Groups Tabs

function jm_move_group_activity_tab() {
  global $bp;
  if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) {
//    $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['position'] = '98';
    $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = 'Activity';
    $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['name'] = 'Discussion';
  }
}
add_action('bp_init', 'jm_move_group_activity_tab');
Advertisements

Reorder and Rename the groups tab in Buddypress

function redirect_group_home() {
  global $bp;
  $path = clean_url( $_SERVER['REQUEST_URI'] );
  $path = apply_filters( 'bp_uri', $path );
  if (bp_is_group_home() && strpos( $path, $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['slug'] ) === false ) {
    if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
      bp_core_redirect( $path . 'courseware/' );
    }
  }
}
function move_group_activity_tab() {
  global $bp;
  if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) {
//    $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['position'] = '98';
    $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = 'Activity';
    $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['name'] = 'Discussion';
  }
}
add_action('bp_init', 'redirect_group_home' );
add_action('bp_init', 'move_group_activity_tab');