Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sub Navigation renaming


  • eVersatile
    Participant

    @eversatile

    Hello,
    I know how to rename and/or remove navigation menus and sub navigation menus though I ran into a problem which I can not find a solution to.
    I am trying to rename a subnav menu though I can not figure out the function and/or the permalink.
    The menu in question is ‘Groups>Memberships’ I am trying to rename “memberships” though the permalink shows /groups/ I do not know how to change it since it is also set as a parent

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

  • modemlooper
    Moderator

    @modemlooper

    This is for the admin bar:

    function custom_adminbar_titles() {
        global $wp_admin_bar;
    
            $wp_admin_bar->add_menu( array(
                    'id'    => 'my-account-groups-memberships',
                    'title' => 'new title here',
                )
    
            );
    }
    add_action( 'wp_before_admin_bar_render', 'custom_adminbar_titles' );

    This is for profile menu:

    function change_profile_submenu_tabs(){
    	global $bp;
    
    	$bp->bp_options_nav['groups']['my-groups']['name'] = 'new name here';
    }
    add_action('bp_setup_nav', 'change_profile_submenu_tabs', 999);

    eVersatile
    Participant

    @eversatile

    Very good, I have used that code though it is not working in this situation. Kind of why I ran into a wall.

    The sub nav for groups > memberships is empty.
    For example: the slug for groups is /members/users/groups/ and the sub nav “memberships” slug is /members/users/groups/ so what would I put into the second slug? I’ve tried “/” and just leaving it empty but that doesn’t work.
    and $bp->bp_nav[‘groups’][‘name’] = ‘new name’; will not work either since it’s a sub nav.


    eVersatile
    Participant

    @eversatile

    Ah nevermind. apparently it was “my-groups” duh lol. I don’t know why it wouldn’t show up as a slug though.
    Could you possibly help me one another issue?
    Within the groups I have changed all of the navigation menu using;

    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'] = 'new name';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = 'new name';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['members']['name'] = 'new name';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['admin']['name'] = 'new name';
        $bp->bp_options_nav[$bp->groups->current_group->slug]['send-invites']['name'] = 'new name';
      }
    }
    add_action('bp_init', 'jm_move_group_activity_tab');

    Though, I am unable to get the “forum” slug to change. I have tried many other options though nothing seems to work. Do you know if there may be another script for just that?


    modemlooper
    Moderator

    @modemlooper

    try bp_setup_nav instead of bp_init


    eVersatile
    Participant

    @eversatile

    Good idea. I tried but receive the same results.


    modemlooper
    Moderator

    @modemlooper

    tab names not right or priority off

    add_action(‘bp_setup_nav’, ‘jm_move_group_activity_tab’, 999);


    eVersatile
    Participant

    @eversatile

    That line didn’t work either.
    I’ve tried on a clean install also, I receive the same results.
    I’m wondering if there must be some other function since it’s buddypress integrating with bbpress.


    eVersatile
    Participant

    @eversatile

    The solution is

    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Forums' ) {
    	$translated_text = 'Chapters';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    Thank you for your help


    swatitiwariit90
    Participant

    @swatitiwariit90

    Thankyou, @eVersatile

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Sub Navigation renaming’ is closed to new replies.
Skip to toolbar