This filter can be used to add custom options for each choice.


gform.addFilter('gform_append_field_choice_option', function (str, field, i) {
    // define the markup for your custom option
    return str;


  • str string

    An empty string, to be replaced with your custom markup.

  • field array

    The current field object.

  • i integer

    The index of the current choice.


This example adds a new option to the choice setting called custom.

It uses the gform_editor_js action to load the code snippet on the form editor page.

add_action( ‘gform_editor_js’, ‘custom_option_editor_script’ );
function custom_option_editor_script() {

Source Code

This filter is located in js.php