The GF_Field_Option class extends the GF_Field class, also known as the Field Object. This class is responsible for handling the Option field. Because Option fields are either a Drop Down, Radio Button, or Checkbox, this class only adds some settings and sets the title for the field in the editor. The rendering of the Option field is handled by the class associated with its sub-type. The field “type” property will be set to “option” and the field “inputType” property will be “select”, “radio”, or “checkbox”.
For more details about rendering the Option field, check out the articles below:
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 admin label $admin_label = $field->adminLabel;
The following settings are available for the field:
Controls whether the “Admin Field Label” setting appears.
Controls whether the “Enable Conditional Logic” setting appears.
Controls whether the “Custom CSS Class” setting displays. This allows a custom css to be used for the field.
Controls whether the “Default Values” section displays. This allows a value to be set for the field.
Controls whether the “Description” setting appears. This allows a description for the field to be displayed.
Controls whether the “Field Label” setting which allows the label to be changed appears.
Determines whether the “Field Type” drop down displays. This allows the type of Option field to be chosen. Current choices are “Drop Down”, “Checkboxes”, and “Radio Buttons”.
Controls whether the “Allow field to be populated dynamically” setting appears.
Determines whether the “Product Field Mapping” section displays. This allows you to select to which product field the Option is associated.
The source code is located in includes/fields/class-gf-field-option.php in the Gravity Forms folder of your sites plugins directory.