GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
search-field-checkbox.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the search CHECKBOX input field (supports multi-select)
4  *
5  * @file class-search-widget.php See for usage
6  */
7 
9 $view_id = $gravityview_view->getViewId();
11 
12 // Make sure that there are choices to display
13 if( empty( $search_field['choices'] ) ) {
14  gravityview()->log->debug( 'search-field-checkbox.php - No choices for field' );
15  return;
16 }
17 
18 ?>
19 <div class="gv-search-box gv-search-field-checkbox">
20  <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
21  <label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label>
22  <?php } ?>
23  <p>
24  <?php foreach( $search_field['choices'] as $choice ) { ?>
25 
26  <label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio">
27  <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>[]" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true, 'checked' ); ?>>
28  <?php echo esc_html( $choice['text'] ); ?>
29  </label>
30 
31  <?php } ?>
32  </p>
33 </div>
static getInstance( $passed_post=NULL)
gravityview()
The main GravityView wrapper function.
gv_empty( $value, $zero_is_empty=true, $allow_string_booleans=true)
Is the value empty?
gv_selected( $value, $current, $echo=true, $type='selected')
Similar to the WordPress selected(), checked(), and disabled() functions, except it allows arrays to ...