GravityView  1.19.4
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 $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
19 
20  var $_gf_field_class_name = 'GF_Field_Number';
21 
22  var $group = 'standard';
23 
24  public function __construct() {
25  $this->label = esc_html__( 'Number', 'gravityview' );
26  parent::__construct();
27  }
28 
29  function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
30 
31  $field_options['number_format'] = array(
32  'type' => 'checkbox',
33  'label' => __( 'Format number?', 'gravityview' ),
34  'desc' => __('Display numbers with thousands separators.', 'gravityview'),
35  'value' => false,
36  );
37 
38  $field_options['decimals'] = array(
39  'type' => 'number',
40  'label' => __( 'Decimals', 'gravityview' ),
41  'desc' => __('Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview'),
42  'value' => '',
43  'merge_tags' => false,
44  );
45 
46  return $field_options;
47  }
48 
49 }
50 
Modify field settings by extending this class.
field_options($field_options, $template_id, $field_id, $context, $input_type)
$field_id
Definition: time.php:17
Add custom options for number fields.