GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-number.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-number.php
4  * @package GravityView
5  * @subpackage includes\fields
6  * @since 1.13
7  */
8 
9 /**
10  * Add custom options for number fields
11  *
12  * @since 1.13
13  */
15 
16  var $name = 'number';
17 
18  var $is_searchable = true;
19 
20  var $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
21 
22  /** @see GF_Field_Number */
23  var $_gf_field_class_name = 'GF_Field_Number';
24 
25  var $group = 'standard';
26 
27  var $icon = 'dashicons-editor-ol';
28 
29  public function __construct() {
30  $this->label = esc_html__( 'Number', 'gk-gravityview' );
31  parent::__construct();
32  }
33 
34  public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
35 
36  $field_options['number_format'] = array(
37  'type' => 'checkbox',
38  'label' => __( 'Format number?', 'gk-gravityview' ),
39  'desc' => __('Display numbers with thousands separators.', 'gk-gravityview'),
40  'value' => false,
41  'group' => 'field',
42  );
43 
44  $field_options['decimals'] = array(
45  'type' => 'number',
46  'label' => __( 'Decimals', 'gk-gravityview' ),
47  'desc' => __('Precision of the number of decimal places. Leave blank to use existing precision.', 'gk-gravityview'),
48  'value' => '',
49  'merge_tags' => false,
50  'group' => 'field',
51  );
52 
53  return $field_options;
54  }
55 
56 }
57 
Modify field settings by extending this class.
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
if(empty( $created_by)) $form_id
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22
Add custom options for number fields.