Completed
Pull Request — develop (#1487)
by Gennady
07:54
created

GravityView_Field_Text::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @file class-gravityview-field-text.php
4
 * @package GravityView
5
 * @subpackage includes\fields
6
 */
7
8
class GravityView_Field_Text extends GravityView_Field {
9
10
	var $name = 'text';
11
12
	var $_gf_field_class_name = 'GF_Field_Text';
13
14
	var $is_searchable = true;
15
16
	var $search_operators = array( 'contains', 'is', 'isnot', 'starts_with', 'ends_with' );
17
18
	var $group = 'standard';
19
20
	public function __construct() {
21
		$this->label = esc_html__( 'Single Line Text', 'gravityview' );
22
		parent::__construct();
23
	}
24
25
	/**
26
	 * @inheritDoc
27
	 * @since 2.9.1 Added "This content is numeric" setting
28
	 */
29
	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
30
31
		$this->add_field_support( 'is_numeric', $field_options );
32
33
		return $field_options;
34
	}
35
}
36
37
new GravityView_Field_Text;
38