I was trying to override the template buddypress.php to change the text Forum from Buddypress Profile page. I tried adding as given below to override using child theme but I didn't see any changes. So am I doing it right?
I copied wpforo/wpf-includes/integration/buddypress.php
added this to wp-content/themes/onepress-child/wpforo/wpf-includes/integration/buddypress.php
I opened the file buddypress.php and chanced the word Forum in Line no 57 but still I don't see any changes.
'name' => __( 'Community', 'wpforo' ),
Please let me know if there is other way of doing this.
Note: I tried changing this in WpForo files and works perfectly. When I try to override using child theme this fails to show up.
Hi @writetoyogen,
this cannot be reached by doing such customization. You should add the following code in your current active theme functions.php file:
Don't forget to change the red mark code before using.
function my_custom_buddypress_forum_menu_name($translation, $text, $domain){
if( $domain == 'wpforo' ) {
$backtrace = wp_debug_backtrace_summary();
if( strpos(strtolower($backtrace), 'wpf_forums_component->setup_nav') !== false ){
if( strtolower($text) == 'forums' ) $translation = 'Community';
}
}
return $translation;
}
add_filter('gettext', 'my_custom_buddypress_forum_menu_name', 10, 3);