Created
January 24, 2019 11:54
-
-
Save davewardle/fe795be6993237018774fe4948de57ff to your computer and use it in GitHub Desktop.
Sets a default retention policy
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 | |
function default_gravity_forms_retention_policy( $form, $is_new ) { | |
if ( $is_new ) { | |
$form['personalData']['preventIP'] = true; | |
$form['personalData']['retention'] = [ | |
'policy' => 'delete', | |
'retain_entries_days' => 45 | |
]; | |
GFAPI::update_form( $form ); | |
} | |
} | |
add_action( 'gform_after_save_form', 'default_gravity_forms_retention_policy', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment