wp-includes/comment-template.php:1914Retrieves HTML content for reply to post link.
$argsarrayoptionalarray()$add_belowstringdefault: is 'post'
$respond_idstringdefault: 'respond'
$reply_textstringdefault: is 'Leave a Comment'
$login_textstringdefault: is 'Log in to leave a Comment'
$beforestringdefault: empty
$afterstringdefault: empty
$postint|WP_Postoptionalnullstring|falseOne hook fires while get_post_reply_link() runs, in this order:
Filters the formatted post comments link HTML.
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 );}Introduced in 2.7.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string|false|null to string|false.verified against sourcesrc/wp-includes/comment-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.