Set Orphaned Entry Expiration Duration

Modify how long entries submitted from a nested form should be saved before being moved to the trash.

Code

Filename: gpnf-set-orphaned-entry-expiration-duration.php

<?php
/**
 * Gravity Perks // Nested Forms // Set Orphaned Entry Expiration Duration
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 *
 * Modify how long entries submitted from a nested form should be saved before being moved to the trash.
 */
// Expire orphaned entries after 30 days (1 month).
add_filter( 'gpnf_expiration_modifier', function() {
	return MONTH_IN_SECONDS;
} );

// Never expire orphaned entries.
add_filter( 'gpnf_expiration_modifier', function() {
	return 100 * YEAR_IN_SECONDS;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.