Skip to content

Instantly share code, notes, and snippets.

@AllenWhittaker
Last active March 15, 2019 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllenWhittaker/8cb53b651d96c3435d9196dd8d1e8c73 to your computer and use it in GitHub Desktop.
Save AllenWhittaker/8cb53b651d96c3435d9196dd8d1e8c73 to your computer and use it in GitHub Desktop.
Drop Down Search
add_action("gform_pre_render", "set_chosen_options");
function set_chosen_options($form){
?>
<script type="text/javascript">
gform.addFilter('gform_chosen_options', 'set_chosen_options_js');
function set_chosen_options_js(options, element){
options.search_contains = true;
return options;
}
</script>
<?php
//return the form object from the php hook
return $form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment