Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sets a default retention policy
<?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
You can’t perform that action at this time.