wphooks.info - comment_duplicate_trigger

comment_duplicate_trigger

The hook occurs in the following file:

wp-includes/comment.php:
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
	$dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $commentdata );

	if ( $dupe_id ) {
		/**
		 * Fires immediately after a duplicate comment is detected.
		 *
		 * @since 3.0.0
		 *
		 * @param array $commentdata Comment data.
		 */
		do_action( 'comment_duplicate_trigger', $commentdata );
		if ( true === $avoid_die ) {
			return new WP_Error( 'comment_duplicate', __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 );
		} else {
			if ( wp_doing_ajax() ) {
				die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
			}

			wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 );
		}