respond_link

Filters the respond link when a post has no comments.

Description

apply_filters( 'respond_link', (string) $respond_link, (integer) $id ); 

Parameters (2)

0. $respond_link (string)
The default response link.
1. $id (integer)
The post ID.

Usage

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

Defined (1)

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

/wp-includes/comment-template.php  
  1. echo apply_filters( 'respond_link', $respond_link, $id );