gform_field_advanced_settings

gform_field_advanced_settings

IntroductionUsageParametersExamplesPlacementSource Code

Introduction
Use this filter to create a new field setting under the Advanced tab. Useful when implementing a new custom field type that requires custom settings.
Usage
1add_action( 'gform_field_advanced_settings', 'my_advanced_settings', 10, 2 );

Parameters

$position integer
Specifies the position that the settings will be displayed. For a list of all available positions, search form_detail.php for 「gform_field_advanced_settings」 or review the Advanced Field Settings article.

$form_id integer
The ID of the form from which the entry value was submitted.

Examples
This example creates a new Advanced setting on position 50 (right after the Admin Label setting), that specifies if the field data should be encrypted. This code sample works in Gravity Forms 2.4, 2.5 and later.
1234567891011121314151617181920212223242526272829303132333435add_action( 'gform_field_advanced_settings', 'my_advanced_settings', 10, 2 );function my_advanced_settings( $position, $form_id ) {    //create settings on position 50 (right after Admin Label)    if ( $position == 50 ) {        ?>        

  •                                 
  •                 EncryptionCheck this box to encrypt this field's data";    return $tooltips;}
    Placement
    This code should be placed in the functions.php file of your active theme.
    Source Code
    This filter is located in form_detail.php.

    gform_field_added

    gform_field_added

    DescriptionUsageParametersExamplesSource Code

    Description
    The 「gform_field_added」 JavaScript filter in Gravity Forms fires after a form field is added, either in the Form Editor or programmatically.
    Usage
    12345678

    Parameters

    event Event Object
    Default JS event object.

    form Form Object
    The current form object.

    field Field Object
    The current field object.

    Examples
    This example uses the gform_admin_pre_render filter to load the hook. A message is displayed when the form id is 44 and new fields are added.
    1234567891011121314add_action( 'gform_admin_pre_render', 'pre_render_function' );function pre_render_function( $form ) {    ?>        

    gform_export_separator

    gform_export_separator

    DescriptionUsageParametersExamplesPlacementSource Code

    Description
    Use this filter to change the column separator character for the entry export file. The default separator is a comma (,).
    Usage
    add_filter( 'gform_export_separator', 'change_separator', 10, 2 );

    You can also target a specific form by adding the form id after the filter name.
    add_filter( 'gform_export_separator_6', 'change_separator', 10, 2 );

    Parameters

    $separator string
    Value of the separator character to be filtered.

    $form_id integer
    ID of the current form.

    Examples
    This example changes the separator to a pipe (|).
    add_filter( 'gform_export_separator', 'change_separator', 10, 2 );
    function change_separator( $separator, $form_id ) {
    return '|';
    }

    Placement
    This code should be placed in the functions.php file of your active theme.
    Source Code
    This action hook is located in GFExport::start_export() in export.php.

    gform_export_page_VIEW

    gform_export_page_VIEW

    DescriptionUsageParametersExamplesSource Code

    Description
    Add custom pages (i.e. 「views」) to the Import/Export section.
    Usage
    Specify the view name after the gform_export_page_ hook name:
    add_action( 'gform_export_page_my_custom_page', 'my_custom_function' );

    Parameters
    There are no parameters for this action.
    Examples
    This example demonstrates how to display the content for your custom page and also how to add a menu item to link to this custom page on the Import/Export section via the gform_export_menu filter.
    // let's add our menu item first with the 'gform_export_menu' filter
    add_filter( 'gform_export_menu', 'my_custom_export_menu_item' );
    function my_custom_export_menu_item( $menu_items ) {

    $menu_items[] = array(
    'name' => 'my_custom_export_page',
    'label' => __( 'My Custom Export Page' )
    );

    return $menu_items;
    }

    // now let's display the the content of our custom page
    add_action( 'gform_export_page_my_custom_export_page', 'my_custom_export_page' );
    function my_custom_export_page() {

    GFExport::page_header();

    echo 'My Custom Export Page Settings!';

    GFExport::page_footer();

    }

    Source Code
    This filter is located in GFExport::export_page() in export.php.

    gform_export_menu

    gform_export_menu

    DescriptionUsageParametersExamplesSource Code

    Description
    Add new or modify default menu items which will appear in the Import/Export section menu.
    Usage
    Apply to all forms:
    1add_filter( 'gform_export_menu', 'my_custom_function' );
    Parameters

    $menu_items array
    An array of menu items to be displayed on the Import/Export page menu.

    Examples
    This example demonstrates how you can add a custom menu item to the Import/Export page menu. It also demonstrates (with the use of the gform_export_page_view filter) how to display content for this page when selected.
    1234567891011121314151617181920212223// add custom menu itemadd_filter( 'gform_export_menu', 'my_custom_export_menu_item' );function my_custom_export_menu_item( $menu_items ) {     $menu_items[] = array(        'name' => 'my_custom_export_page',        'label' => __( 'My Custom Export Page' )        );     return $menu_items;} // display content for custom menu item when selectedadd_action( 'gform_export_page_my_custom_export_page', 'my_custom_export_page' );function my_custom_export_page() {     GFExport::page_header();     echo 'My Custom Export Page Settings!';     GFExport::page_footer(); }
    Source Code
    This filter is located in GFExport::get_tabs() in export.php.

    gform_export_max_execution_time

    gform_export_max_execution_time

    DescriptionUsageParametersExamplePlacementSinceSource Code

    Description
    Allows the maximum execution time for exporting entries to be changed.
    When the maximum execution time is reached, the export routine stops briefly and submits another AJAX request to continue exporting entries from the point it stopped.
    Usage
    add_filter( 'gform_export_max_execution_time', 'your_function_name, 10, 2 );

    Parameters

    $max_execution_time int
    The number of seconds for which each request should run. Defaults to 20.

    $form Form Object
    The current form.

    Example
    add_filter( 'gform_export_max_execution_time', 'change_export_time', 10, 2 );
    function change_export_time( $max_execution_time, $form ){
    //change the execution time to 60 seconds
    return 60;
    }

    Placement
    This code should be placed in the functions.php file of your active theme.
    Since
    This filter was added in Gravity Forms version 2.0.3.10.
    Source Code
    This filter is located in GFExport::start_export() in export.php.

    gform_export_lines

    gform_export_lines

    DescriptionUsageParametersExamplePlacementSource CodeSince

    Description
    This filter can be used to allow the csv entry export lines to be filtered just before they are saved to the temporary file.
    Usage
    add_filter( 'gform_export_lines', 'your_function_name' );

    Parameters

    $lines string
    The lines to be included in the .csv export.

    Example
    This example fixes an issue on Excel for Mac.
    add_filter( 'gform_export_lines', 'fix_csv_entry_export' );
    function fix_csv_entry_export ( $lines ) {
    return mb_convert_encoding( $lines, 'UTF-16LE', 'UTF-8' );
    }

    Placement
    This code should be placed in the functions.php file of your active theme.
    Source Code
    $lines = apply_filters( 'gform_export_lines', $lines );

    This filter is located in GFExport::start_export() in export.php.
    Since
    This filter was added in Gravity Forms 1.9.1.

    gform_export_line

    gform_export_line

    DescriptionUsageParametersPlacementSinceSource Code

    Description
    Filter the current line being exported.
    Usage
    The following would apply to all forms:
    add_filter( 'gform_export_line', 'append_lines_to_row', 10, 6 );

    Parameters

    $line string
    The current line being exported.

    $form array
    The current form object.

    $fields array
    An array of field IDs to be exported.

    $field_rows array
    An array of List fields.

    $entry array
    The current entry.

    $separator string
    The separator.

    Placement
    This code should be placed in the functions.php file of your active theme.
    Since
    This filter was added in Gravity Forms version 2.4.11.5.
    Source Code
    This filter is located in GFExport::prepare_forms_for_export() in export.php.

    gform_export_forms_forms

    gform_export_forms_forms

    DescriptionUsageParametersExamplesPlacementSinceSource Code

    Description
    The 「gform_export_forms_forms」 filter in Gravity Forms allows the forms displayed on the Export Forms page to be filtered.
    Usage
    1add_filter( 'gform_export_forms_forms', 'your_function_name', 10, 1 );

    Parameters

    $forms array
    The complete list of forms.

    Examples
    123456add_filter( 'gform_export_forms_forms', 'filter_forms', 10, 1 );function filter_forms( $forms ){    //remove half of the forms    $forms = array_slice( $forms, 0, round( count( $forms ) / 2 ) );    return $forms;}
    Placement
    This code should be placed in the functions.php file of your active theme.
    Since
    This filter was added in Gravity Forms version 2.4.6.16.
    Source Code
    This filter is located in GFExport::export_form_page() in export.php.

    gform_export_form

    gform_export_form

    DescriptionUsageParametersExamplePlacementSinceSource Code

    Description
    Allows modification of the form meta before export.
    Usage
    The following would apply to all forms:
    add_filter( 'gform_export_form', 'modify_form_for_export', 10, 1 );

    To target a specific form, append the form id to the hook name. (format: gform_export_form_FORMID)
    add_filter( 'gform_export_form_1', 'modify_form_for_export', 10, 1 );

    Parameters

    $form Form Object
    The current form.

    Example
    add_filter( 'gform_export_form', 'modify_form_for_export' );
    function modify_form_for_export( $form ) {
    $form['exported'] = true;
    return $form;
    }

    add_filter( 'gform_export_form', 'modify_form_for_export' );
    function modify_form_for_export( $form ) {
    $form['title'] = 'Export of ' . $form['title'];
    return $form;
    }

    Placement
    This code should be placed in the functions.php file of your active theme.
    Since
    This filter was added in Gravity Forms version 1.8.8.
    Source Code
    This filter is located in GFExport::prepare_forms_for_export() in export.php.