wp-includes/comment-template.php:1755Retrieves HTML content for reply to comment link.
$argsarrayoptionalarray()$add_belowstringdefault: 'comment'
$respond_idstringdefault: 'respond'
$reply_textstringdefault: 'Reply'
$reply_to_textstringdefault: 'Reply to %s'. Should start with the visible reply_text value
$show_reply_to_textbooldefault: false
$login_textstringdefault: 'Log in to Reply'
$max_depthintdefault: 0
$depthintdefault: 0
$beforestringdefault: empty
$afterstringdefault: empty
$commentint|WP_Commentoptionalnull$postint|WP_Postoptionalnullstring|false|null2 hooks fire while get_comment_reply_link() runs, in this order:
Filters the comment reply link arguments.
Filters the comment reply link.
function get_comment_reply_link( $args = array(), $comment = null, $post = null ) { $defaults = array( 'add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __( 'Reply' ), /* translators: Comment reply button text. %s: Comment author name. */ 'reply_to_text' => __( 'Reply to %s' ), 'login_text' => __( 'Log in to Reply' ), 'max_depth' => 0, 'depth' => 0, 'before' => '', 'after' => '', 'show_reply_to_text' => false, ); $args = wp_parse_args( $args, $defaults ); $args['max_depth'] = (int) $args['max_depth']; $args['depth'] = (int) $args['depth']; if ( 0 === $args['depth'] || $args['max_depth'] <= $args['depth'] ) { return null; } $comment = get_comment( $comment ); if ( empty( $comment ) ) { return null; } if ( empty( $post ) ) { $post = $comment->comment_post_ID; } $post = get_post( $post ); if ( ! comments_open( $post->ID ) ) { return false; } if ( get_option( 'page_comments' ) ) { $permalink = str_replace( '#comment-' . $comment->comment_ID, '', get_comment_link( $comment ) ); } else { $permalink = get_permalink( $post->ID ); } /** * Filters the comment reply link arguments. * * @since 4.1.0 * * @param array $args Comment reply link arguments. See get_comment_reply_link() * for more information on accepted arguments. * @param WP_Comment $comment The object of the comment being replied to. * @param WP_Post $post The WP_Post object. */ $args = apply_filters( 'comment_reply_link_args', $args, $comment, $post ); if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { $link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', esc_url( wp_login_url( get_permalink() ) ), $args['login_text'] ); } else { $data_attributes = array( 'commentid' => $comment->comment_ID, 'postid' => $post->ID, 'belowelement' => $args['add_below'] . '-' . $comment->comment_ID, 'respondelement' => $args['respond_id'], 'replyto' => sprintf( $args['reply_to_text'], get_comment_author( $comment ) ), ); $data_attribute_string = ''; foreach ( $data_attributes as $name => $value ) { $data_attribute_string .= " data-{$name}=\"" . esc_attr( $value ) . '"'; } $data_attribute_string = trim( $data_attribute_string );Introduced in 2.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/comment-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.