disable flood control

This commit is contained in:
Matthias Pfefferle 2020-12-28 23:33:26 +01:00
parent f07ae2ea8c
commit 46436cb49b

View file

@ -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 // do not require email for AP entries
\add_filter( 'pre_option_require_name_email', '__return_false' ); \add_filter( 'pre_option_require_name_email', '__return_false' );
$state = \wp_new_comment( $commentdata, true ); $state = \wp_new_comment( $commentdata, true );
\remove_filter( 'pre_option_require_name_email', '__return_false' ); \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 // do not require email for AP entries
\add_filter( 'pre_option_require_name_email', '__return_false' ); \add_filter( 'pre_option_require_name_email', '__return_false' );
$state = \wp_new_comment( $commentdata, true ); $state = \wp_new_comment( $commentdata, true );
\remove_filter( 'pre_option_require_name_email', '__return_false' ); \remove_filter( 'pre_option_require_name_email', '__return_false' );
// re-add flood control
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
} }
} }