Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • sr3
    Participant

    @sr3

    Thanks, I only needed to override the author name in blog post comments, so I searched for the related code in the plugin, modified it and added it to my functions.php in my child theme. Now the username is displayed instead of the full name 🙂

    function sr_get_comment_author( $author ) {
    	global $bp, $comment;
    
    	if( $comment->user_id) {
    		$user=get_userdata($comment->user_id);
    		echo $user->user_nicename;
    	} else {
    		return $author;
    	}
    }
    add_filter( 'get_comment_author', 'sr_get_comment_author' );
Viewing 1 replies (of 1 total)
Skip to toolbar