gform_temp_file_expiration_days

Description

The gform_temp_file_expiration_days filter can be used to override the number of days before temporary file uploads are deleted.

Usage

add_filter( 'gform_temp_file_expiration_days', 'your_function_name' );

Parameters

  • $expiration_days int
    The number of days temporary files should remain in the uploads directory. Default is 2 or 30 if save and continue is enabled.
  • $form Form Object
    The form currently being processed.

Example

add_filter( 'gform_temp_file_expiration_days', 'temp_file_expiration_days' );
function temp_file_expiration_days( $expiration_days ) {
    $expiration_days = 90;
    return $expiration_days;
}

Placement

Since

This filter was added in Gravity Forms 2.1.3.5.

Source Code

This filter is located in GFFormDisplay::clean_up_files() in form_display.php.