comment_reply_link( array $args = array(), int|WP_Comment $comment = null, int|WP_Post $post = null )

Displays the HTML content for reply to comment link.


Description

Top ↑

See also


Top ↑

Parameters

$args

(array) (Optional) Override default options.

Default value: array()

$comment

(int|WP_Comment) (Optional) Comment being replied to. Default current comment.

Default value: null

$post

(int|WP_Post) (Optional) Post ID or WP_Post object the comment is going to be displayed on. Default current post.

Default value: null


Top ↑

Source

File: wp-includes/comment-template.php

function comment_reply_link( $args = array(), $comment = null, $post = null ) {
	echo get_comment_reply_link( $args, $comment, $post );
}


Top ↑

Changelog

Changelog
Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Fabiano Alencar
    <?php comment_reply_link( array_merge($args, array(
        'reply_text' => __('Responder <span>&darr;</span>', 'textdomain'),
        'depth'      => $depth,
        'max_depth'  => $args['max_depth']
        )
    )); ?>
  2. Skip to note 2 content
    Contributed by thejaydip

    Replace class on reply link using below code.

    function wpdocs_comment_reply_link_class( $class ) {
    	$class = str_replace( "class='comment-reply-link", "class='comment-reply-link your-class-name", $class );
    	return $class;
    }
    
    add_filter( 'comment_reply_link', 'wpdocs_comment_reply_link_class' );
    

You must log in before being able to contribute a note or feedback.