Skip to main content

Filter: gform_field_choice_markup_pre_render

Dynamic Hook Name

This hook supports dynamic naming with the following modifiers:

  1. $this->formId
  2. $this->id

Example hook names:

  • gform_field_choice_markup_pre_render (base hook)
  • gform_field_choice_markup_pre_render_1 (with first modifier value)
  • gform_field_choice_markup_pre_render_1_2 (with all modifier values)

Allows the HTML for a specific choice to be overridden.

Parameters

NameTypeDescription
$choice_markupstringThe choice HTML.
$choicearrayThe choice properties.
$field\GF_Field_RadioThe current field object.
$valuestringThe current field value.

Since

  • 1.9.6
  • 1.9.12: Added the field specific version.
  • 2.4.17: Moved from GF_Field_Radio::get_radio_choices().

Source

  • Defined in includes/fields/class-gf-field-radio.php at line 382
  • Defined in includes/fields/class-gf-field-radio.php at line 469
  • Defined in includes/fields/class-gf-field-checkbox.php at line 1028
  • Defined in includes/fields/class-gf-field-checkbox.php at line 1094
  • Defined in includes/fields/field-decorator-choice/class-gf-field-decorator-choice-checkbox-markup.php at line 123
  • Defined in includes/fields/field-decorator-choice/class-gf-field-decorator-choice-radio-markup.php at line 191
  • Defined in includes/fields/class-gf-field-multiple-choice.php at line 101