Hi,
this can be done via a child-theme or with a function to add to bp-custom.php or child’s functions.php
See examples here: https://codex.buddypress.org/developer/navigation-api/
Hello @danbp,
Thanks for your reply. The link you shared, work for individual user’s profile page. But I don’t required that. I am asking for activity page. Where there is a status update text area and bottom of that links for All Members, Favorites, Mentions etc. I like to change text/label for these “All Members”, “favorites”, “Mentions” etc.
Regards
@arifulalamtuhin,
you can do that via the language file or alter the text of those items directly in the activity template, via a child-theme.
Concerned file is in bp-templates/bp-legacy/buddypress/activity/index.php:72,91,108
@danbp,
Thanks for your quick reply. I can do that. By coping activity directory to WP Theme directory. But the WP theme used breaking page layout. And if fix page layout for activity page, that breaking other page layout. And not have permission to modify WP theme currently. That’s why asking if there any action hook available. 🙂
Thanks again for your help 🙂
Regards
Annoying to work on a site where you’re not allowed to access the child-theme!
As you can see in index.php, there is no action hook for these buttons.
The only other way i know is a dirty trick using directly gettext.
Add this to bp-custom.php
function abcd_gettext( $translated, $original_text, $domain ) {
if ( 'buddypress' !== $domain )
return $translated;
switch ( $original_text ) {
case 'All Members %s':
return 'All Buddies %s';
case 'My Friends %s':
return 'My Amigos %s';
default:
return $translated;
}
}
add_filter( 'gettext', 'abcd_gettext', 10, 3 );
More about that trick here:
https://buddypress.org/support/topic/how-do-i-change-the-title-of-the-create-an-account-page/#post-254772
Hello @danbp,
Thanks for your dirty way trick. That works and not too. Like, I added a case
case 'My Favorites %s':
return 'Likes %s';
After that when I load/refresh the activity page, that changes “My Favorites” to “Likes”. Awesome!
But whenever, I unlike all liked activity, and then again like a activity, instead of “Likes”, that showing “My Favorites”
Regards
Yep, you’re right, the forced translation comes only if you reload the page.
That’s the dark side of a dirt trick. 😉
Now, in a very real use case, this wouldn’t happen very often for not saying never. Most users will (hopefully for you) favorite activities, but i don’t believe that many will favorite and suddenly decide to unfavorite all their stuff and will restart immediatly to fav…
If you don’t agree with this, you still have the possibility to change text in the template or to use the po/mo file.
In witch language is your site ?
site is in english. 🙂
Not to worry for now as authority decided not to show that section in activity page.
Thanks for all your effort 🙂
Regards