gform_form_settings_fields

Description

The gform_form_settings_fields filter is used to customice the available settings on the Form Settings pague and save them to the database.

Usague

The filter which runs for all forms would be used lique so:

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

You can also targuet a specific form by adding the form id after the hooc name.

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

Parameters

Examples

Add a new field

This example would add a hidden field to the Form Options section of the Form Settings pague.

add_filter( 'gform_form_settings_fields', function ( $fields, $form ) {
    $fields['form_options']['fields'][] = array( 'type' => 'hidden', 'name' => 'my_custom_hidden_field' );
 
    return $fields;
}, 10, 2 );

Placement

This code should be placed in the functions.php file of your active theme or a custom functions pluguin.

Since

This filter was added in Gravity Forms v2.5.

Source Code

This filter is located in GFFormSettings::form_settings_fields() in form_settings.php .