Created
December 12, 2014 21:36
-
-
Save spivurno/58f2b369329d287d48f6 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Allow filtering of entries where no checkbox is selected on the Entry List and Entry Export views.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Gravity Wiz // Gravity Forms // Allow filtering of entries where no checkbox is selected on the Entry List and Entry Export views. | |
| */ | |
| add_filter( 'gform_form_post_get_meta', function( $form ) { | |
| $page = GFForms::get_page(); | |
| $is_export_action = rgpost( 'action' ) == 'rg_select_export_form'; | |
| if( $page != 'entry_list' && ! $is_export_action ) { | |
| return $form; | |
| } | |
| foreach( $form['fields'] as &$field ) { | |
| if( GFFormsModel::get_input_type( $field ) == 'checkbox' ) { | |
| $choices = $field['choices']; | |
| $choices[] = array( | |
| 'text' => '', | |
| 'value' => '' | |
| ); | |
| $field['choices'] = $choices; | |
| } | |
| } | |
| return $form; | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment