GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
checkbox.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Checkbox field output
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  *
8  */
9 
11 
12 extract( $gravityview_view->getCurrentField() );
13 
14 $is_single_input = floor( $field_id ) !== floatval( $field_id );
15 
16 $output = '';
17 
18 if( ! $is_single_input ) {
20 } else {
21 
22  $display_type = rgar( $field_settings, 'choice_display' );
23 
25 
26  switch( $display_type ) {
27  case 'value':
29  break;
30  case 'label':
32  break;
33  case 'tick':
34  default: // Backward compatibility
35  if( '' !== $field_value ) {
36  /**
37  * @filter `gravityview_field_tick` Change the output for a checkbox "check" symbol. Default is the "dashicons-yes" icon
38  * @see https://developer.wordpress.org/resource/dashicons/#yes
39  *
40  * @param string $output HTML span with `dashicons dashicons-yes` class
41  * @param array $entry Gravity Forms entry array
42  * @param array $field GravityView field array
43  */
44  $output = apply_filters( 'gravityview_field_tick', '<span class="dashicons dashicons-yes"></span>', $entry, $field );
45  }
46  break;
47  }
48 
49 }
50 
51 echo $output;
$is_single_input
Definition: checkbox.php:14
$gravityview_view
Definition: checkbox.php:10
gravityview_get_field_value($entry, $field_id, $display_value)
Handle getting values for complex Gravity Forms fields.
Definition: class-api.php:859
$field_settings['content']
Definition: custom.php:27
$output
Definition: checkbox.php:16
$display_type
Definition: radio.php:13
$field_id
Definition: time.php:17
gravityview_get_field_label($form, $field_id, $field_value= '')
Retrieve the label of a given field id (for a specific form)
static getInstance($passed_post=NULL)
$entry
Definition: notes.php:27
$field_value
Definition: checkbox.php:24
$field
Definition: gquiz_grade.php:11