Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Forum Tab


  • eVersatile
    Participant

    @eversatile

    Hello,
    I have been trying to change the tab ‘forum’ in groups. Not the slug, the name of it. I’d like “Forums” to read “Chapters”.
    Here is the script I currently have on there.

    function mb_profile_menu_tabs(){
    global $bp;
    $bp->bp_nav['activity']['name'] = 'Updates';
    $bp->bp_nav['groups']['name'] = 'Books';
    $bp->bp_nav['buddyblog']['name'] = 'Library';
    $bp->bp_options_nav['profile']['change-avatar']['name'] = 'Change Profile Picture';
    $bp->bp_options_nav['buddyblog']['my-posts']['name'] = 'Library';
    unset($bp->bp_nav['forums']);
    unset($bp->bp_nav['groups']);
    unset($bp->bp_nav['forums']);
    bp_core_remove_subnav_item( 'buddyblog', 'edit' );
    }
    add_action('bp_setup_nav', 'mb_profile_menu_tabs', 201);
    function change_profile_submenu_tabs(){
    global $bp;
    $bp->bp_options_nav['groups']['my-groups']['name'] = 'Authored & Edited Books';
    $bp->bp_options_nav['groups']['invites']['name'] = 'Invites to be Editor';
    }
    add_action('bp_setup_nav', 'change_profile_submenu_tabs', 999);
    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]['forum']['name'] = 'not working';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = 'Updates';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['members']['name'] = 'Editors';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['admin']['name'] = 'Details';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['send-invites']['name'] = 'Invite Editors';
      }
    }
    add_action('bp_setup_nav', 'jm_move_group_activity_tab', 999);
    add_action( 'bp_setup_nav', 'remove_group_unwanted_subnav_tab',500 );
     function remove_group_unwanted_subnav_tab() {
    
    bp_core_remove_subnav_item( bp_get_current_group_slug(), 'admin' );
    }

    I have tried it on a clean install as well and nothing seems to work. $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['name'] = 'not working'; Should be the line which changes the name of “Forums” tab but nothing is happening. Is there any other function specifically for this tab?

Viewing 6 replies - 1 through 6 (of 6 total)

  • Robin W
    Moderator

    @robin-w

    probably more of a buddypress question – try their support forum


    peter-hamilton
    Participant

    @peter-hamilton

    Have you looked into changing the .POT file?


    eVersatile
    Participant

    @eversatile

    I have asked in the buddypress forum and have not came up with an answer. Since bbPress is where the forum comes from I figured someone would be of better assistance here.
    Yes, I have tried the .pot file and it had no effect.


    Robin W
    Moderator

    @robin-w

    since you are trying to change a function in buddypress viz ‘bp_setup_nav’ then logically it is buddypress.

    Anyway try

    //This function changes the text wherever it is quoted
    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Forums' ) {
    	$translated_text = 'Chapters';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    eVersatile
    Participant

    @eversatile

    @robin-w thank you for you support and insight. After several weeks no one in the buddypress forums was able to figure this out. Though, your solution worked flawlessly; I hope this post helps others as well. Thank you for your time and effort.


    Robin W
    Moderator

    @robin-w

    Great – glad you’re fixed !

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar