untested, but this should work
add_filter( 'bbp_get_reply_author_display_name' , 'rew_reply_change_to_first_name', 10 , 2 ) ;
function rew_reply_change_to_first_name ($author_name, $reply_id) {
// Get the author ID
$author_id = bbp_get_reply_author_id( $reply_id );
$user = get_userdata($author_id);
$first_name = $user->user_firstname;
return $first_name ;
}
add_filter( 'bbp_get_topic_author_display_name' , 'rew_topic_change_to_first_name', 10 , 2 ) ;
function rew_topic_change_to_first_name ($author_name, $topic_id) {
// Get the author ID
$author_id = bbp_get_topic_author_id( $topic_id );
$user = get_userdata($author_id);
$first_name = $user->user_firstname;
return $first_name ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
Hi Robin!
Thank you so much, that worked as expected! One question/ issue though – the objective is to completely anonymise the user, however, when you hover over the “first name” the user link still shows their first and last name
example http://www.mywebsite.com/user/daviddossantos
I guess this would be a difficult one to solve as the link uses their “username” so if thats set to firstnamelastname then we cant change it… right?
Thank you for your help on this.
David
pretty much – if you want to not show user profiles, then use
bbp style pack
once activated go to
dashboard>settings>bbp style pack>Profile
where you can set profiles not to display