gform_dropdown_no_results_text

Description

Use this filter to change the default “No Results” placeholder text on Drop Down fields when using the enhanced user interface.

Usage

add_filter( 'gform_dropdown_no_results_text', 'set_no_results_text', 10, 2 );

You can also target a specific form by adding the form id after the hook name.

add_filter( 'gform_dropdown_no_results_text_6', 'set_no_results_text', 10, 2 );

Parameters

  • $text string

    The text to be filtered.

  • $form_id integer

    ID of current form.

Examples

This example changes the no results text to “No results found”.

add_filter( 'gform_dropdown_no_results_text_185', 'set_no_results_text', 10, 2 );
function set_no_results_text( $text, $form_id ) {
return 'No results found';
}

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in GFFormDisplay::get_chosen_init_script() in form_display.php.