Skip to content

Instantly share code, notes, and snippets.

@daela
daela / filter_gf_select_optgroup.php
Created March 25, 2017 14:04 — 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. The
* filter will then automagically wrap the options following until the start of
* the next option group
*/
add_filter( 'gform_field_content', 'filter_gf_select_optgroup', 10, 2 );
function filter_gf_select_optgroup( $input, $field ) {
@daela
daela / gist:68dede52566988e54206
Last active September 13, 2015 03:11 — forked from mcdonc/gist:3890756
Chris' Sublime Text 2 Emacsey keybindings
[
// Chris' "emacs refugee" Sublime Text 2 key mappings. Depends on
// sublemacspro and Wrap Plus packages, plus a custom pdb.set_trace snippet
// named set_trace.sublime-snippet. It outs me as someone who uses cursor
// keys; try not to judge.
// "bol"/"eol" goes to a logical begin/end of line; we want it to go to true
// line begin/end, so we use hardbol/hardeol instead for ctrl-a and ctrl-e