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

GravityView_Field_Text   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A field_options() 0 6 1
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