gform_form_args

gform_form_args

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
The filter gform_form_args provides the ability to modify the options used to display the form.
Usage
1add_filter( 'gform_form_args', 'your_function_name', 10, 1 );

Parameters

$form_args array
An array of Form Arguments when adding it to a page/post (like the ID, Title, AJAX or not, etc.). Possible values in array:

form_id – the form id or title
display_title – true/false
display_description – true/false
force_display – true/false
field_values – An array of dynamic population parameter keys with their corresponding values to be populated.
ajax – true/false
tabindex – number

Examples
1234567add_filter( 'gform_form_args', 'setup_form_args' );function setup_form_args( $form_args ) {    $form_args['display_title'] = false;    $form_args['display_description'] = true;     return $form_args;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 1.9.
Source Code
This filter is located in GFFormDisplay::get_form() in form_display.php.

发表回复

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