Created
May 10, 2018 21:42
-
-
Save craigsimps/b055080e1a6784b4ad6d48b396522892 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 | |
add_filter( 'gform_form_post_get_meta', __NAMESPACE__ . '\\enforce_gravity_forms_anti_spam_honeypot' ); | |
/** | |
* Enforce anti-spam honeypot on all Gravity forms. | |
* | |
* @param array $form The current form to be filtered. | |
* | |
* @return array | |
*/ | |
function enforce_gravity_forms_anti_spam_honeypot( $form ): array { | |
$form['enableHoneypot'] = true; | |
return $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment