Filter hook 'comment_id_fields'

in WP Core File wp-includes/comment-template.php at line 2070

View Source

comment_id_fields

Filter Hook
Description
Filters the returned comment ID fields.

Hook Information

File Location wp-includes/comment-template.php View on GitHub
Hook Type Filter
Line Number 2070

Hook Parameters

Type Name Description
string $comment_id_fields The HTML-formatted hidden ID field comment elements.
int $post_id The post ID.
int $reply_to_id The ID of the comment being replied to.

Usage Examples

Basic Usage
<?php
// Hook into comment_id_fields
add_filter('comment_id_fields', 'my_custom_filter', 10, 3);

function my_custom_filter($comment_id_fields, $post_id, $reply_to_id) {
    // Your custom filtering logic here
    return $comment_id_fields;
}

Source Code Context

wp-includes/comment-template.php:2070 - How this hook is used in WordPress core
<?php
2065  	 *
2066  	 * @param string $comment_id_fields The HTML-formatted hidden ID field comment elements.
2067  	 * @param int    $post_id           The post ID.
2068  	 * @param int    $reply_to_id       The ID of the comment being replied to.
2069  	 */
2070  	return apply_filters( 'comment_id_fields', $comment_id_fields, $post_id, $reply_to_id );
2071  }
2072  
2073  /**
2074   * Outputs hidden input HTML for replying to comments.
2075   *

PHP Documentation

<?php
/**
	 * Filters the returned comment ID fields.
	 *
	 * @since 3.0.0
	 *
	 * @param string $comment_id_fields The HTML-formatted hidden ID field comment elements.
	 * @param int    $post_id           The post ID.
	 * @param int    $reply_to_id       The ID of the comment being replied to.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.