gform_import_form_xml_options

gform_import_form_xml_options

DescriptionUsageParametersExamplesSource Code

Description
Modify the settings used to import a form from an XML export file. Useful when adding your own field types with custom settings stored as an array.
Usage
add_filter( 'gform_import_form_xml_options', 'my_custom_function' );

Parameters

$options array
Array of options for the XML import.

Examples
In this example we demonstrate how to specify that a custom form setting should be unserialized as an array (rather than an object). This assumes that the setting is created in an array format. When the form is exported to XML it will no longer be in array format so on import we need to specify how it should be formatted.
add_filter( 'gform_import_form_xml_options', 'my_custom_import_xml_options' );
function my_custom_import_xml_options( $options ) {
$options['my_custom_form_setting'] = array( 'unserialize_as_array' => true );
return $options;
}

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

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注