Skip to content

Instantly share code, notes, and snippets.

@maymond
maymond / filter_gf_select_optgroup.php
Last active June 19, 2018 20:11 — forked from codearachnid/filter_gf_select_optgroup.php
Add the optgroup ability to Gravity Forms default select field.
/**
* Filter Gravity Forms select field display to wrap optgroups where defined
* USE:
* set the value of the select option to `optgroup` within the form editor.
* Optionally end the group by setting the option value to `optgroupend`. The
* filter will then automagically wrap the options following until the start of
* the next option group
*/