目次
functions.php
add_filter( 'get_comment_author', 'my_comment_author_by_display_name' );
function my_comment_author_by_display_name( $author ) {
$comment = get_comment( $comment_ID );
if ( $comment->user_id ) {
$author = get_the_author_meta( 'display_name', $comment->user_id );
}
return $author;
}
コメント