get_post_reply_link

The timeline below displays how wordpress function get_post_reply_link has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Retrieves HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array       $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $post_reply_link = $args['before'] . $link . $args['after'];
    /**
     * Filters the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $post_reply_link The HTML-formatted post comments link.
     * @param int|WP_Post $post            The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $post_reply_link, $post);
}

WordPress Version: 5.5

/**
 * Retrieves HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array       $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filters the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 5.4

/**
 * Retrieves HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filters the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 5.3

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filters the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 4.6

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return false|null|string Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filters the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 4.2

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return false|null|string Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filter the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 4.1

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return false|null|string Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = sprintf('<a rel="nofollow" href="%s">%s</a>', wp_login_url(get_permalink()), $args['login_text']);
    } else {
        $onclick = sprintf('return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id']);
        $link = sprintf("<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>", get_permalink($post->ID) . '#' . $args['respond_id'], $onclick, $args['reply_text']);
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filter the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 4.0

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    $add_below = $args['add_below'];
    $respond_id = $args['respond_id'];
    $reply_text = $args['reply_text'];
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = '<a rel="nofollow" href="' . wp_login_url(get_permalink()) . '">' . $args['login_text'] . '</a>';
    } else {
        $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#{$respond_id}' onclick='return addComment.moveForm(\"{$add_below}-{$post->ID}\", \"0\", \"{$respond_id}\", \"{$post->ID}\")'>{$reply_text}</a>";
    }
    $formatted_link = $args['before'] . $link . $args['after'];
    /**
     * Filter the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 3.9

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
 *                              The resulting value is passed as the first parameter to addComment.moveForm(),
 *                              concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
 *                              to addComment.moveForm(), and appended to the link URL as a hash value.
 *                              Default 'respond'.
 *     @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
 *     @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string $before     Text or HTML to add before the reply link. Default empty.
 *     @type string $after      Text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
 *                             Default current post.
 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = '<a rel="nofollow" href="' . wp_login_url(get_permalink()) . '">' . $login_text . '</a>';
    } else {
        $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#{$respond_id}' onclick='return addComment.moveForm(\"{$add_below}-{$post->ID}\", \"0\", \"{$respond_id}\", \"{$post->ID}\")'>{$reply_text}</a>";
    }
    $formatted_link = $before . $link . $after;
    /**
     * Filter the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}

WordPress Version: 3.7

/**
 * Retrieve HTML content for reply to post link.
 *
 * @since 2.7.0
 *
 * @param array $args {
 *     Optional. Override default arguments.
 *
 *     @type string 'add_below'  The first part of the selector used to identify the comment to respond below.
 *                               The resulting value is passed as the first parameter to addComment.moveForm(),
 *                               concatenated as $add_below-$comment->comment_ID. Default is 'post'.
 *     @type string 'respond_id' The selector identifying the responding comment. Passed as the third parameter
 *                               to addComment.moveForm(), and appended to the link URL as a hash value. Default is 'respond'.
 *     @type string 'reply_text' The text of the Reply link. Default is 'Leave a Comment'.
 *     @type string 'login_text' The text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
 *     @type string 'before'     The text or HTML to add before the reply link. Default empty.
 *     @type string 'after'      The text or HTML to add after the reply link. Default empty.
 * }
 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
 */
function get_post_reply_link($args = array(), $post = null)
{
    $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $post = get_post($post);
    if (!comments_open($post->ID)) {
        return false;
    }
    if (get_option('comment_registration') && !is_user_logged_in()) {
        $link = '<a rel="nofollow" href="' . wp_login_url(get_permalink()) . '">' . $login_text . '</a>';
    } else {
        $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#{$respond_id}' onclick='return addComment.moveForm(\"{$add_below}-{$post->ID}\", \"0\", \"{$respond_id}\", \"{$post->ID}\")'>{$reply_text}</a>";
    }
    $formatted_link = $before . $link . $after;
    /**
     * Filter the formatted post comments link HTML.
     *
     * @since 2.7.0
     *
     * @param string      $formatted The HTML-formatted post comments link.
     * @param int|WP_Post $post      The post ID or WP_Post object.
     */
    return apply_filters('post_comments_link', $formatted_link, $post);
}