Show nickname instead of username
-
Hi, I would like to display nickname (and not username) in the whole bbpress forum.
For topics list, I modified the code from a previous topic Show username instead of full name / display name and it works well so far.
The modified codes that I use is as follows:
add_filter( 'bbp_get_reply_author_display_name' , 'rew_reply_change_to_nickname', 10 , 2 ) ; function rew_reply_change_to_nickname ($author_name, $reply_id) { // Get the author ID $author_id = bbp_get_reply_author_id( $reply_id ); $nickname = um_get_display_name( $author_id ); return $nickname ; } add_filter( 'bbp_get_topic_author_display_name' , 'rew_topic_change_to_nickname', 10 , 2 ) ; function rew_topic_change_to_nickname ($author_name, $topic_id) { // Get the author ID $author_id = bbp_get_topic_author_id( $topic_id ); $nickname = um_get_display_name( $author_id ); return $nickname ; }
Note: I use Ultimate Member (UM) plugin to display user details.
However, when comes to user profile, I’m struggling on how to force display nickname right above the avatar. Hope you can help me with that.
Note: It’s very tedious to modify “display name publicly as” from the WordPress dashboard for every registered user. Thus hopefully codes may well do the job for me.
- You must be logged in to reply to this topic.