Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phillipwilhelm/17b669e19f0ff63285ccccb601d2b109 to your computer and use it in GitHub Desktop.
Save phillipwilhelm/17b669e19f0ff63285ccccb601d2b109 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.
/**
* 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