From 6698543be34e794394837a5222f0873346af5c1d Mon Sep 17 00:00:00 2001
From: Joshua Purdy <jpurdy647@gmail.com>
Date: Tue, 30 May 2017 17:42:03 -0400
Subject: [PATCH] Add filter `require_valid_content` to bypass WP Error when
 submitted comment is empty

---
 wp-includes/comment.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index ba60070fd..e31c396b7 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -3069,7 +3069,10 @@ function wp_handle_comment_submission( $comment_data ) {
 	}
 
 	if ( '' == $comment_content ) {
-		return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 );
+		$require_valid_comment = apply_filters('require_valid_comment', true, $commentdata );
+		if ($require_valid_comment){
+			return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 );
+		}
 	}
 
 	$commentdata = compact(
-- 
2.11.0.windows.1

