gform_dropbox_file_name

gform_dropbox_file_name

DescriptionUsageParametersExamples1. Use an entry value in the filename.PlacementSource Code

Description
This filter can be used to override the filename before the file is uploaded to Dropbox.
Usage
The following would apply to all forms:
add_filter( 'gform_dropbox_file_name', 'your_function_name', 10, 5 );

To target a specific form append the form id to the hook name. (format: gform_dropbox_file_name_FORMID)
add_filter( 'gform_dropbox_file_name_10', 'your_function_name', 10, 5 );

Parameters

$file_name string
The filename, including extension, e.g. screenshot.png.

$form Form Object
The form currently being processed.

$field_id string
The ID of the field currently being processed.

$entry Entry Object
The entry currently being processed.

$feed Feed Object
The feed currently being processed.

Examples
1. Use an entry value in the filename.
This example shows how you can use a value from the Entry Object when modifying the filename.
add_filter( 'gform_dropbox_file_name_10', 'change_name', 10, 5 );
function change_name( $file_name, $form, $field_id, $entry, $feed ) {

return rgar( $entry, 'id' ) . '-' . $file_name;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_dropbox_file_name', $form['id'], $file['name'], $form, $field_id, $entry, $feed )

This filter is located in the following methods in class-gf-dropbox.php:

GFDropbox::upload_file()
GFDropbox::process_dropbox_fields()

gform_disable_print_form_scripts

gform_disable_print_form_scripts

DescriptionUsageParametersExamples1. Disable printing of scripts and stylesheets for all forms2. Target a specific formPlacementSinceSource Code

Description
This filter can be used to prevent scripts and stylesheets being printed when GFCommon::gform_do_shortcode() processes form shortcodes located in various form settings and confirmations after headers have been sent. Scripts and stylesheets would be enqueued instead.
Usage
The following would apply to all forms.
add_filter( 'gform_disable_print_form_scripts', 'your_function_name' );

Parameters

$disable_print_form_script bool
Should printing of the scripts and stylesheets be disabled? Default is false.

$form Form Object
The form object for the shortcode being processed.

$is_ajax bool
Indicates if ajax was enabled on the shortcode.

Examples
1. Disable printing of scripts and stylesheets for all forms
add_filter( 'gform_disable_print_form_scripts', '__return_true' );

2. Target a specific form
add_filter( 'gform_disable_print_form_scripts', 'disable_print_form_scripts', 10, 2 );
function disable_print_form_scripts( $disable_print_form_script, $form) {
if ( $form['id'] == 10 ) {
return true;
}

return $gform_disable_print_form_scripts;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.0.
Source Code
This filter is located in GFCommon::gform_do_shortcode() in common.php.

gform_dropbox_ssl_compatibility

gform_dropbox_ssl_compatibility

DescriptionUsageParametersPlacementSource Code

Description
The filter hook allows the SSL compatibility checks within the Dropbox add-on to be overridden. It is useful if a false negative is reported for an installed SSL certificate.
Usage
1add_filter( 'gform_dropbox_ssl_compatibility', '__return_true' );

Parameters

$ssl_support bool
If SSL is supported. If the gravityformsaddon_gravityformsdropbox_ssl option is present, returns true. Otherwise, result of checks.

Placement
This code should be placed in the functions.php file of your active theme, or ideally, in its own plugin.
Source Code
This filter is located in dropbox.php.

gform_dropbox_folder_path

gform_dropbox_folder_path

DescriptionUsageParametersExamples1. Use an entry value in the destination pathPlacementSource Code

Description
This filter can be used to override the destination folder configured on the Dropbox feed.
Usage
The following would apply to all forms:
1add_filter( 'gform_dropbox_folder_path', 'your_function_name', 10, 5 );
To target a specific form append the form id to the hook name. (format: gform_dropbox_folder_path_FORMID)
1add_filter( 'gform_dropbox_folder_path_10', 'your_function_name', 10, 5 );
Parameters

$folder_path string
The folder in the Dropbox account where the files will be stored, e.g. /local.wordpress.dev.

$form Form Object
The form currently being processed.

$field_id string
The ID of the field currently being processed.

$entry Entry Object
The entry currently being processed.

$feed Feed Object
The feed currently being processed.

Examples
1. Use an entry value in the destination path
This example shows how you can use a field value from the Entry Object when modifying the path.
12345add_filter( 'gform_dropbox_folder_path_10', 'change_path', 10, 5 );function change_path( $folder_path, $form, $field_id, $entry, $feed ) {     return $folder_path . '/' . rgar( $entry, '5' );}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
1gf_apply_filters( 'gform_dropbox_folder_path', $form['id'], $file['destination'], $form, $field_id, $entry, $feed )
This filter is located in the following methods in class-gf-dropbox.php:

GFDropbox::upload_file()
GFDropbox::process_dropbox_fields()

gform_disable_registration

gform_disable_registration

DescriptionUsageParametersExamplesSource Code

Description
The 「gform_disable_registration」 filter allows add-ons to prevent the User Registration add-on from registering/updating a user.
Usage
Applies to all forms.
1add_filter( 'gform_disable_registration', 'your_function_name', 10, 3 );

Parameters

$is_disabled bool
True or false.

$form Form Object
The submitted form object.

$entry Entry Object
The entry object from which the user was registered.

$fulfilled bool
True or false. This may be a value passed from an add-on like PayPal which indicates that the payment has been fulfilled. Null as of version 3.0.

Examples
Below is an example which disables registration based on submitted form values.
123456789101112131415add_filter( 'gform_disable_registration', 'disable_registration', 10, 3 );function disable_registration( $is_disabled, $form, $entry ) {    //check form id and if not the form being checked simply status passed in to function    if ( $form['id'] != 160 ) {        return $is_disabled;    }     //check submitted values to decide if registration should be stopped    if ( rgar( $entry, '4' ) == 'No' && rgar( $entry, '5' ) == 'No' ) {        //disable registration        return true;    } else {        return false;    }}
Source Code
1$disable_registration = apply_filters( 'gform_disable_registration', false, $form, $entry, null /* $fullfilled deprecated */ );
This filter is located in GF_User_Registration::process_feed() in class-gf-user-registration.php.

gform_dropbox_store_local_version

gform_dropbox_store_local_version

DescriptionUsageParametersExamples1. Simple Usage2. Advanced UsagePlacementSource Code

Description
This filter can be used to keep a local copy of the file being retained once it has been uploaded to Dropbox.
Usage
The following would apply to all forms:
add_filter( 'gform_dropbox_store_local_version', 'your_function_name', 10, 6 );

To target a specific form append the form id to the hook name. (format: gform_dropbox_store_local_version_FORMID)
add_filter( 'gform_dropbox_store_local_version_10', 'your_function_name', 10, 6 );

To target a specific field append both the form id and the field id to the hook name. (format: gform_dropbox_store_local_version_FORMID_FIELDID)
add_filter( 'gform_dropbox_store_local_version_10_3', 'your_function_name', 10, 6 );

Parameters

$store_local_version boolean
Should a local copy of the file be retained? Default is false.

$file array
The file properties.
array(
'name' => basename( $entry[ rgar( $field, 'id' ) ] ),
'path' => str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $entry[ rgar( $field, 'id' ) ] ),
'url' => $entry[ $field['id'] ],
'destination' => rgars( $feed, 'meta/destinationFolder' ),
);

$field_id string
The ID of the field currently being processed.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$feed Feed Object
The feed currently being processed.

Examples
1. Simple Usage
This example shows the simplest way to use the hook.
add_filter( 'gform_dropbox_store_local_version', '__return_true' );

2. Advanced Usage
This example shows how you can determine if a local copy should be retained based on the name of the feed and a field value in the Entry Object.
add_filter( 'gform_dropbox_store_local_version_10', 'maybe_store_local_version', 10, 6 );
function maybe_store_local_version( $store_local_version, $file, $field_id, $form, $entry, $feed ) {
if ( rgars( $feed, 'meta/feedName') == 'Dropbox Feed 2' && rgar( $entry, '5' ) == 'No' ) {
return true;
}

return $store_local_version;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_dropbox_store_local_version', array( $form['id'], $field_id ), false, $file, $field_id, $form, $entry, $feed )

This filter is located in GFDropbox::upload_file() in class-gf-dropbox.php.

gform_disable_form_legacy_css

gform_disable_form_legacy_css

DescriptionUsageParametersExamples1. Disable the CSSPlacementSinceSource Code

Description
The gform_disable_form_legacy_css filter allows the CSS to be disabled for forms using the legacy markup, usually forms created with Gravity Forms 2.4 and earlier.
Usage
The filter which would run for all forms using the legacy markup would be used like so:
add_filter( 'gform_disable_form_legacy_css', 'your_function_name' );

Parameters

$disabled bool
Whether to disable the CSS.

Examples
1. Disable the CSS
add_filter( 'gform_disable_form_legacy_css', '__return_true' );

Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.5.
Source Code
This filter is located in GFFormDisplay::get_form_enqueue_assets() in form_display.php.

gform_dropbox_link_type

gform_dropbox_link_type

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter can be used to change the type of link returned by Dropbox.
Usage
The following would apply to all forms:
add_filter( 'gform_dropbox_link_type', 'your_function_name', 10, 3 );

To target a specific form append the form id to the hook name. (format: gform_dropbox_link_type_FORMID)
add_filter( 'gform_dropbox_link_type_10', 'your_function_name', 10, 3 );

To target a specific field append both the form id and the field id to the hook name. (format: gform_dropbox_link_type_FORMID_FIELDID)
add_filter( 'gform_dropbox_link_type_10_3', 'your_function_name', 10, 3 );

Parameters

$linkType string
The Dropbox link type. Possible values: preview (a preview link to the document for sharing) or direct (an expiring link to download the contents of the file). Default: preview.

$form Form Object
The form currently being processed.

$field_id string
The ID of the field currently being processed.

Example
This example shows how to change the link type for a specific form.
add_filter( 'gform_dropbox_store_local_version_10', 'change_link_type', 10, 3 );
function change_link_type( $linkType, $form, $field_id ) {

return 'direct';
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
gf_apply_filters( 'gform_dropbox_link_type', array( $form['id'], $this->id ), 'preview', $form, $this->id )

This filter is located in GF_Field_Dropbox::get_form_inline_script_on_page_render() in class-gf-field-dropbox.php.

gform_disable_view_counter

gform_disable_view_counter

DescriptionUsageParametersExamples1. Disable for all forms2. Enable for a specific form3. Disable for a specific ipPlacementSource CodeSince

Description
This filter can be used to prevent the forms view counter being incremented. The views column will remain displayed on the Forms page.
Usage
The following would apply to all forms.
1add_filter( 'gform_disable_view_counter', 'your_function_name' );
To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_disable_view_counter_FORMID)
1add_filter( 'gform_disable_view_counter_5', 'your_function_name' );

Parameters

$view_counter_disabled bool
Is the view counter disabled. Default false.

Examples
1. Disable for all forms
1add_filter( 'gform_disable_view_counter', '__return_true' );
2. Enable for a specific form
1add_filter( 'gform_disable_view_counter_12', '__return_false' );
3. Disable for a specific ip
12345678add_filter( 'gform_disable_view_counter', 'disable_view_count_by_ip' );function disable_view_count_by_ip( $view_counter_disabled ) {   if ( GFFormsModel::get_ip() == 'SOMEIP' ) {        return true;   }    return $view_counter_disabled;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFFormDisplay::get_form() in form_display.php
Since
This filter was added in Gravity Forms 1.8.17.

gform_disable_form_theme_css

gform_disable_form_theme_css

DescriptionUsageParametersExamples1. Disable the themePlacementSinceSource Code

Description
The gform_disable_form_theme_css filter allows the default theme used by forms created with Gravity Forms 2.5 and greater to be disabled.
Usage
The filter which would run for all forms would be used like so:
add_filter( 'gform_disable_form_theme_css', 'your_function_name' );

Parameters

$disabled bool
Whether to disable the theme css.

Examples
1. Disable the theme
add_filter( 'gform_disable_form_theme_css', '__return_true' );

Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.5.
Source Code
This filter is located in GFFormDisplay::get_form_enqueue_assets() in form_display.php.