The GF_Field_Hidden class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Hidden field and the Hidden Quantity field are rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
//get the field $field = GFFormsModel::get_field( $form, 1 ); //get the label $label = $field->label;
The following settings are available for the field:
Controls whether the “Default Values” section displays. This allows a value to be set for the field.
Controls whether the “Field Label” setting which allows the label to be changed appears.
Controls whether the “Allow field to be populated dynamically” setting appears.
Below is a listing of the properties inherited from the parent class, and the properties unique to the field:
- allowsPrepopulate boolean
Determines if the field values can be dynamically populated. Default is false.
The default value to be set in the field. If this is not changed, it is the value submitted.
The form ID.
The field ID.
The parameter name used when dynamically populating the field.
This property is only available if this is a hidden Quantity field. The inputType will be set to hidden, while the type will be set to quantity.
The field label that will be displayed on the form and on the admin pages.
This property is only available if this is a hidden Quantity field. The id of the product field to which the field is associated.
The field type. This is set to “hidden”, unless this is a hidden Quantity field, then the type will be quantity.
The source code is located in includes/fields/class-gf-field-hidden.php in the Gravity Forms folder of your sites plugins directory.