-
-
Save billerickson/b0e5a78edde80002e0c37eb4504918c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WPForms Email Blacklist | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/wpforms-email-blacklist | |
* | |
* @param string $honeypot, empty if not spam, honeypot text is used in WPForms Log | |
* @param array $fields | |
* @param array $entry | |
* @param array $form_data | |
*/ | |
function be_wpforms_email_blacklist( $honeypot, $fields, $entry, $form_data ) { | |
// Use the email as the key. The value will be used in the log | |
$blacklist = array( | |
'info@ranksindia.com' => 'Ranks India', | |
); | |
foreach( $form_data['fields'] as $id => $field ) { | |
if( 'email' == $field['type'] && array_key_exists( $entry['fields'][$id], $blacklist ) ) | |
$honeypot = '[Blacklist] ' . $blacklist[$entry['fields'][$id]]; | |
} | |
return $honeypot; | |
} | |
add_filter( 'wpforms_process_honeypot', 'be_wpforms_email_blacklist', 10, 4 ); |
It should still work. The filter is still in place in WPForms.
If you're having issues, I recommend contacting WPForms support.
They are saying that it doesn't work because it's old. I have been in contact many times today. Oh well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm sorry to say that this doesn't work now.