Skip to main content

GF_Field_Option

Source: includes/fields/class-gf-field-option.php:8

Details​

  • Kind: class
  • Namespace: (global)
  • Extends: GF_Field

Properties​

PropertyTypeDescription
$repeatableboolWhether the field can be used in a repeater.

Methods​

MethodDescription
get_form_editor_field_description()Returns the field's form editor description.
get_form_editor_field_icon()Returns the field's form editor icon.
get_value_save_input()Sanitize and format the value before it is saved to the Entry Object.

Method Reference​

get_form_editor_field_description()​

public function get_form_editor_field_description()

Returns the field's form editor description.

Returns​

  • string

Since: 2.5

Source: includes/fields/class-gf-field-option.php:48

get_form_editor_field_icon()​

public function get_form_editor_field_icon()

Returns the field's form editor icon.

This could be an icon url or a gform-icon class.

Returns​

  • string

Since: 2.5

Source: includes/fields/class-gf-field-option.php:61

get_value_save_input()​

public function get_value_save_input( $value, $form, $input_name, $entry_id, $entry, $repeater_index='' )

Sanitize and format the value before it is saved to the Entry Object.

Parameters​

NameTypeDefaultDescription
$valuestringThe value to be saved.
$formarrayThe Form object currently being processed.
$input_namestringThe input name used when accessing the $_POST.
$entry_idintThe ID of the entry currently being processed.
$entryarrayThe entry currently being processed.
$repeater_indexstring''The repeater index if the field is inside a repeater.

Returns​

  • array | string — The sanitized and formatted input value to be saved.

Since: 3.0.0

Source: includes/fields/class-gf-field-option.php:79