bookmark_bordergform_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

    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

This code should be placed in the functions.php file of your active theme, or within its own plugin.

Source Code

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

Since

This filter was added in Gravity Forms 2.1.3.5.