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.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註