Description
The gform_gfcf_theme_config
filter can be used to modify the global JavaScript configuration object for conversational forms before it’s localized to the frontend.
Usage
add_filter( 'gform_gfcf_theme_config', 'your_function_name', 10, 2 );
Parameters
Parameter | Type | Description |
---|---|---|
$strings | array | The global JavaScript configuration object containing animation settings, form data, and internationalization strings. |
$form_id | int | The ID of the current conversational form. |
Examples
Customize animation settings for conversational forms.
add_filter( 'gform_gfcf_theme_config', 'customize_conversational_animations', 10, 2 );
function customize_conversational_animations( $strings, $form_id ) {
// Modify field animation delay
$strings['data']['animation_settings']['fields']['delay'] = 50;
// Change animation duration
$strings['data']['animation_settings']['fields']['duration'] = 300;
// Customize welcome screen animation
$strings['data']['animation_settings']['welcome']['in_duration'] = 800;
return $strings;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms Conversational Forms v1.0.0
Source Code
This filter is located in /class-gf-conversational-forms.php.