From 46436cb49b630d7302c5c11dd255695eaab4fe3f Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 28 Dec 2020 23:33:26 +0100 Subject: [PATCH] disable flood control --- includes/rest/class-inbox.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 3b35f48..61e6dbe 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -309,12 +309,18 @@ class Inbox { ), ); + // disable flood control + \remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 ); + // do not require email for AP entries \add_filter( 'pre_option_require_name_email', '__return_false' ); $state = \wp_new_comment( $commentdata, true ); \remove_filter( 'pre_option_require_name_email', '__return_false' ); + + // re-add flood control + \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); } /** @@ -348,11 +354,17 @@ class Inbox { ), ); + // disable flood control + \remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 ); + // do not require email for AP entries \add_filter( 'pre_option_require_name_email', '__return_false' ); $state = \wp_new_comment( $commentdata, true ); \remove_filter( 'pre_option_require_name_email', '__return_false' ); + + // re-add flood control + \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); } }