Using Gravity Forms ‘gform_dropbox_request_timeout’ PHP filter

The gform_dropbox_request_timeout filter in the Gravity Forms Dropbox Add-On allows you to modify the request timeout length for the feed processing request.

Usage

add_filter('gform_dropbox_request_timeout', 'your_function_name', 10, 1);

Parameters

  • $timeout (int): The time in seconds before the connection is dropped and an error returned.

More information

See Gravity Forms Docs: gform_dropbox_request_timeout

Examples

Increase Timeout to 90 Seconds

Increase the request timeout length to 90 seconds.

add_filter('gform_dropbox_request_timeout', 'gf_change_timeout');
function gf_change_timeout($timeout) {
    return 90; // Change 90 to a higher value if needed.
}

Decrease Timeout to 30 Seconds

Decrease the request timeout length to 30 seconds.

add_filter('gform_dropbox_request_timeout', 'gf_lower_timeout');
function gf_lower_timeout($timeout) {
    return 30; // Change 30 to a lower value if needed.
}

Double the Timeout

Double the current request timeout length.

add_filter('gform_dropbox_request_timeout', 'gf_double_timeout');
function gf_double_timeout($timeout) {
    return $timeout * 2;
}

Set Timeout Based on a Condition

Set the request timeout length based on a specific condition.

add_filter('gform_dropbox_request_timeout', 'gf_conditional_timeout');
function gf_conditional_timeout($timeout) {
    // Check a specific condition
    if (condition) {
        return 120;
    } else {
        return 60;
    }
}

Apply Timeout Change for a Specific Form

Change the request timeout length only for a specific form.

add_filter('gform_dropbox_request_timeout', 'gf_specific_form_timeout', 10, 2);
function gf_specific_form_timeout($timeout, $form) {
    if ($form['id'] == 5) { // Replace 5 with your form ID
        return 120;
    }
    return $timeout;
}

Note: Make sure to place these code snippets in the functions.php file of your active theme.