Completed
Push — master ( 1a7371...4a1bf4 )
by Stephanie
22s
created

FrmFieldHidden   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A field_settings_for_type() 0 7 1
A include_form_builder_file() 0 3 1
A html5_input_type() 0 3 1
A sanitize_value() 0 3 1
1
<?php
2
3
/**
4
 * @since 3.0
5
 */
6
class FrmFieldHidden extends FrmFieldType {
7
8
	/**
9
	 * @var string
10
	 * @since 3.0
11
	 */
12
	protected $type = 'hidden';
13
14
	/**
15
	 * @var bool
16
	 * @since 3.0
17
	 */
18
	protected $has_input = false;
19
20
	/**
21
	 * @var bool
22
	 * @since 3.0
23
	 */
24
	protected $has_html = false;
25
26
	/**
27
	 * @var bool
28
	 * @since 3.0
29
	 */
30
	protected $holds_email_values = true;
31
32
	protected function field_settings_for_type() {
33
		$settings        = parent::field_settings_for_type();
34
		$settings['css'] = false;
35
		$settings['default'] = true;
36
37
		return $settings;
38
	}
39
40
	protected function include_form_builder_file() {
41
		return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-hidden.php';
42
	}
43
44
	protected function html5_input_type() {
45
		return 'hidden';
46
	}
47
48
	/**
49
	 * @since 4.0
50
	 */
51
	public function sanitize_value( &$value ) {
52
		FrmAppHelper::sanitize_value( 'sanitize_text_field', $value );
53
	}
54
}
55