BuddyDev

Search

[Resolved] How to change the 'Friend' slug to 'Partner'

Tagged: 

  • Participant
    Level: Initiated
    Posts: 15
    nim on #10416

    I am using code given below for changing slug and name of ‘friend’ to ‘partner’

    define ( ‘BP_FRIENDS_SLUG’, ‘partner’ );

    function bpcodex_rename_profile_tabs() {
    buddypress()->members->nav->edit_nav( array( ‘name’ => __( ‘Partner’, ‘textdomain’ ) ), ‘partner’ );

    }
    add_action( ‘bp_setup_nav’, ‘bpcodex_rename_profile_tabs’ );

    This is working fine but the problem with this code is:
    When logged out user go to other user’s profile, the ‘partner’ tab appear. which I want to hide. Without this code the ‘friend’ tab remain hide when user go to other user’s profile.

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #10424

    Hi Nim,
    1. Using the code to change label is a bad idea. IO suggest using the translation tools(poedit) to translate the text.

    If you still want to do that, please change your code to this

    
    
    define ( 'BP_FRIENDS_SLUG', 'partner' );
    
    function bpcodex_rename_profile_tabs() {
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	buddypress()->members->nav->edit_nav( array( 'name' => __( 'Partner', 'textdomain' ) ), 'partner' );
    }
    add_action( 'bp_setup_nav', 'bpcodex_rename_profile_tabs' );
    
    

    Hope that helps.

  • Participant
    Level: Initiated
    Posts: 15
    nim on #10430

    Hi Brajesh, Thank you for your quick response.

    I used the po-editor and changed the label from friend to partner, but no luck.
    (I changed in these two files as path

    wp-content/languages/plugins/buddypres-en_GB.po and buddypress-en_US.po
    and uploaded back po and mo files. Are these the files?

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #10443

    Hi Nim,
    what is your current locale for the WordPress install?
    Please make sure you have uploaded “mo” file(po file is for you to translate).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 15
    nim on #10471

    Hi, Brajesh,
    Thanks a lot… Mark it as solved….

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #10472

    Thank you.

The topic ‘ [Resolved] How to change the 'Friend' slug to 'Partner'’ is closed to new replies.

This topic is: resolved