Skip to content

Instantly share code, notes, and snippets.

View johnolek's full-sized avatar

John Oleksowicz johnolek

View GitHub Profile
@codearachnid
codearachnid / filter_gf_select_optgroup.php
Last active November 10, 2023 10:46
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 ) {
@gregkare
gregkare / flash_hash.md
Last active April 27, 2018 16:51
FlashHash

How to crash Rails > 4.1.0 in a pretty confusing way:

def index
  redirect_to new_post_url, flash: flash
end
NoMethodError: