cancel_comment_reply_link

Filters the cancel comment reply link HTML.

Description

apply_filters( 'cancel_comment_reply_link', (string) $formatted_link, (string) $link, (string) $text ); 

Parameters (3)

0. $formatted_link (string)
The HTML-formatted cancel comment reply link.
1. $link (string)
Cancel comment reply link URL.
2. $text (string)
Cancel comment reply link text.

Usage

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

Defined (1)

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

/wp-includes/comment-template.php  
  1. return apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text );