Last active
March 16, 2017 18:32
-
-
Save sblomberg/fe441a196ba57ef9854102b667000e36 to your computer and use it in GitHub Desktop.
Enable Gravity Forms honeypot by default
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 | |
class Gravity_Forms_Customizations { | |
public static function init() { | |
add_action( 'gform_after_save_form', array( __CLASS__, 'enable_honeypot_on_new_form_creation' ), 10, 2 ); | |
} | |
public static function enable_honeypot_on_new_form_creation( $form, $is_new ) { | |
if ( $is_new ) { | |
$form['enableHoneypot'] = true; | |
\GFAPI::update_form( $form ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment