Skip to main content

gravity_form()

function gravity_form( $id, $display_title=true, $display_description=true, $display_inactive=false, $field_values=null, $ajax=false, $tabindex=0, $echo=true, $form_theme=null, $style_settings=null )

Main Gravity Forms function call.

Should be used to insert a Gravity Form from code.

Since: 2.7.15 (Added $form_theme and $style_settings parameters.)

Source: gravityforms.php:7007

Parameters

NameTypeDefaultDescription
$idstringThe form ID
$display_titlebooltrueIf the form title should be displayed in the form. Defaults to true.
$display_descriptionbooltrueIf the form description should be displayed in the form. Defaults to true.
$display_inactiveboolfalseIf the form should be displayed if marked as inactive. Defaults to false.
$field_valuesarray | nullnullDefault field values. Defaults to null.
$ajaxboolfalseIf submission should be processed via AJAX. Defaults to false.
$tabindexint0Starting tabindex. Defaults to 0.
$echobooltrueIf the field should be echoed. Defaults to true.
$form_themestringnullForm theme slug.
$style_settingsstringnullJSON-encoded style settings. Passing false will bypass the gform_default_styles filter.

Returns

  • string | void