http://hookr.io/functions/bp_add_friend_button/
buddypress\bp-friends\bp-friends-template.php ~Line 338
Thank you @shanebp for your help.
Can you please let me know how to change the text “Add Friend” button text to something else? I have found “Add Friend” text in bp-templates/bp-legacy/buddypress-functions.php file,but when I change the text in that location it does not take effect. It only takes effect once I click on it and then click on “Cancel Friendship Request”. When I refresh the member page, it again shows “Add Friend” text.
Thank you.
Try this in bp-custom.php
function sg_gettext( $translated, $original_text, $domain ) {
if ( 'buddypress' !== $domain )
return $translated;
switch ( $original_text ) {
case 'Add Friend':
return 'Something Else';
default:
return $translated;
}
}
add_filter( 'gettext', 'sg_gettext', 20, 3 );
It works @shanebp 🙂
Thank you so much for your kind help.