Forked from sblomberg/class-gravity-forms-customizations.php
Created
February 14, 2017 06:43
-
-
Save riskiii/bde1cddbb0e3424fcbf8d8271fbf0f34 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