Skip to content

Instantly share code, notes, and snippets.

@jonbrockett
Created January 17, 2019 14:25
Show Gist options
  • Save jonbrockett/655b1fb2c847a044c581c35485eb5aba to your computer and use it in GitHub Desktop.
Save jonbrockett/655b1fb2c847a044c581c35485eb5aba to your computer and use it in GitHub Desktop.
Gravity Forms Enforce Honeypot
<?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