GravityView  2.17
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 = \GV\Utils::get( $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;
gravityview_get_field_label( $form, $field_id, $field_value='')
Retrieve the label of a given field id (for a specific form)
gravityview_get_field_value( $entry, $field_id, $display_value)
Handle getting values for complex Gravity Forms fields.
Definition: class-api.php:1034
$is_single_input
Definition: checkbox.php:14
static getInstance( $passed_post=NULL)
$gravityview_view
Definition: checkbox.php:10
$display_value
$field_settings['content']
Definition: custom.php:27
if(gravityview() ->plugin->is_GF_25()) $form
$output
Definition: checkbox.php:16
$display_type
Definition: radio.php:13
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
$entry
Definition: notes.php:27
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22
$field_value
Definition: checkbox.php:24