comment_reply_link

Filters the comment reply link.

Description

apply_filters( 'comment_reply_link', (string) $args_before_link_args_after, (array) $args, (object) $comment, (WP_Post) $post ); 

Parameters (4)

0. $args_before_link_args_after (string)
The HTML markup for the comment reply link.
1. $args (array)
An array of arguments overriding the defaults.
2. $comment (object)
The object of the comment being replied.
3. $post (WP_Post)
The WP_Post object.

Usage

To run the hook, copy the example below.
  1. $args_before_link_args_after = apply_filters( 'comment_reply_link', $args_before_link_args_after, $args, $comment, $post ); 
  2.  
  3. if ( !empty( $args_before_link_args_after ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the comment_reply_link callback 
  2. function filter_comment_reply_link( $args_before_link_args_after, $args, $comment, $post ) { 
  3. // make filter magic happen here... 
  4. return $args_before_link_args_after
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'comment_reply_link', 'filter_comment_reply_link', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'comment_reply_link', 'filter_comment_reply_link', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/comment-template.php  
  1. return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post );