comment_id_fields

Filters the returned comment id fields.

Description

apply_filters( 'comment_id_fields', (string) $result, (int) $id, (int) $replytoid ); 

Parameters (3)

0. $result (string)
The HTML-formatted hidden id field comment elements.
1. $id (int)
The post ID.
2. $replytoid (int)
The id of the comment being replied to.

Usage

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

Defined (1)

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

/wp-includes/comment-template.php  
  1. return apply_filters( 'comment_id_fields', $result, $id, $replytoid );