From da2634030a40812de378430bf18d673fa86d6e9b Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 26 Feb 2010 19:06:09 +0000 Subject: [PATCH] Add comment_duplicate_trigger hook that is fired when a duplicate comment is detected. Fixes #12188 git-svn-id: http://svn.automattic.com/wordpress/trunk@13434 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 1403cba9b6..7c6bf4b6d4 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -531,6 +531,7 @@ function sanitize_comment_cookies() { * @since 2.0.0 * @uses $wpdb * @uses apply_filters() Calls 'pre_comment_approved' hook on the type of comment + * @uses apply_filters() Calls 'comment_duplicate_trigger' hook on commentdata. * @uses do_action() Calls 'check_comment_flood' hook on $comment_author_IP, $comment_author_email, and $comment_date_gmt * * @param array $commentdata Contains information on the comment @@ -547,6 +548,7 @@ function wp_allow_comment($commentdata) { $dupe .= "OR comment_author_email = '$comment_author_email' "; $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"; if ( $wpdb->get_var($dupe) ) { + do_action( 'comment_duplicate_trigger', $commentdata ); if ( defined('DOING_AJAX') ) die( __('Duplicate comment detected; it looks as though you’ve already said that!') );