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
|
b
|
function wp_handle_comment_submission( $comment_data ) { |
3069 | 3069 | } |
3070 | 3070 | |
3071 | 3071 | if ( '' == $comment_content ) { |
3072 | | return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); |
| 3072 | $require_valid_comment = apply_filters('require_valid_comment', true, $commentdata ); |
| 3073 | if ($require_valid_comment){ |
| 3074 | return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); |
| 3075 | } |
3073 | 3076 | } |
3074 | 3077 | |
3075 | 3078 | $commentdata = compact( |