Filters whether a form submission should be treated as spam. Return true to reject the submission from your own spam detection logic.
apply_filters( 'groundhogg/form/submission_handler/is_spam', $is_spam );
You will receive the current boolean spam determination.
Example
add_filter( 'groundhogg/form/submission_handler/is_spam', 'my_extension_check_spam' );
/**
* Reject submissions from disposable email domains.
*
* @param bool $is_spam
*
* @return bool
*/
function my_extension_check_spam( $is_spam ) {
if ( $is_spam ) {
return true;
}
$email = sanitize_email( $_POST['email'] ?? '' );
$domain = substr( strrchr( $email, '@' ), 1 );
return my_extension_is_disposable_domain( $domain );
}
Was this helpful?
Let us know if this document answered your question. Thatβs the only way we can improve.
