gform_secure_file_download_url

Description

Allows for manual filtering of the download URL to handle conditions such as unusual domain mapping and others.

Usage

The base filter which would run for all forms would be used like so:

add_filter( 'gform_secure_file_download_url', 'your_function_name', 10, 2 );

Parameters

ParameterTypeDescription
$download_urlstringThe URL from which to download the file.
$fieldGF_Field_FileuploadThe field object for further context.

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Since

This filter was added in Gravity Forms 2.1.1.1.

Source Code

This filter is located in GF_Field_FileUpload::get_download_url() in includes/fields/class-gf-field-fileupload.php.