diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 088f8ad..ea7ccca 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -297,8 +297,14 @@ class Inbox { // disable flood control \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 ); + update_option( 'require_name_email', $option ); + // re-add flood control \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); } @@ -330,8 +336,14 @@ class Inbox { // disable flood control \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 ); + update_option( 'require_name_email', $option ); + // re-add flood control \add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); }