duplicate_comment_id
Filters the ID, if any, of the duplicate comment found when creating a new comment.
Return an empty value from this filter to allow what WP considers a duplicate comment.
Usage
add_filter( 'duplicate_comment_id', 'wp_kama_duplicate_comment_id_filter', 10, 2 );
/**
* Function for `duplicate_comment_id` filter-hook.
*
* @param int $dupe_id ID of the comment identified as a duplicate.
* @param array $commentdata Data for the comment being created.
*
* @return int
*/
function wp_kama_duplicate_comment_id_filter( $dupe_id, $commentdata ){
// filter...
return $dupe_id;
}
- $dupe_id(int)
- ID of the comment identified as a duplicate.
- $commentdata(array)
- Data for the comment being created.
Changelog
| Since 4.4.0 | Introduced. |
Where the hook is called
duplicate_comment_id
wp-includes/comment.php 727
$dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $commentdata );