From 8154a715b46afaa8781c9f782bb657521507946e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 14 Nov 2021 17:59:04 +0000 Subject: [PATCH] Comments: Use `get_comment_author()` to retrieve the comment author name in `get_comment_reply_link()`. This ensures that the `get_comment_author` filter is applied to the comment author name as expected. Follow-up to [29822], [47506]. Props mjulian7, audrasjb, chaion07, hellofromTonya, SergeyBiryukov. Fixes #53678. git-svn-id: https://develop.svn.wordpress.org/trunk@52154 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index 1415dd1e2f..7549316b78 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -1736,7 +1736,7 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null 'postid' => $post->ID, 'belowelement' => $args['add_below'] . '-' . $comment->comment_ID, 'respondelement' => $args['respond_id'], - 'replyto' => sprintf( $args['reply_to_text'], $comment->comment_author ), + 'replyto' => sprintf( $args['reply_to_text'], get_comment_author( $comment ) ), ); $data_attribute_string = ''; @@ -1760,7 +1760,7 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null ) ) . '#' . $args['respond_id'], $data_attribute_string, - esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ), + esc_attr( sprintf( $args['reply_to_text'], get_comment_author( $comment ) ) ), $args['reply_text'] ); }