do not require email for AP entries

This commit is contained in:
Matthias Pfefferle 2020-10-09 13:19:17 +02:00
parent 33d3c8c9ab
commit 53aa974461

View file

@ -297,8 +297,14 @@ class Inbox {
// disable flood control // disable flood control
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 ); \remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
// do not require email for AP entries
$option = get_option( 'require_name_email' );
update_option( 'require_name_email', 0 );
$state = \wp_new_comment( $commentdata, true ); $state = \wp_new_comment( $commentdata, true );
update_option( 'require_name_email', $option );
// re-add flood control // re-add flood control
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
} }
@ -330,8 +336,14 @@ class Inbox {
// disable flood control // disable flood control
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 ); \remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
// do not require email for AP entries
$option = get_option( 'require_name_email' );
update_option( 'require_name_email', 0 );
$state = \wp_new_comment( $commentdata, true ); $state = \wp_new_comment( $commentdata, true );
update_option( 'require_name_email', $option );
// re-add flood control // re-add flood control
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
} }