Tagged: 'Friend' slug
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.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.
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 pathwp-content/languages/plugins/buddypres-en_GB.po and buddypress-en_US.po
and uploaded back po and mo files. Are these the files?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
The topic ‘ [Resolved] How to change the 'Friend' slug to 'Partner'’ is closed to new replies.