Completed
Pull Request — master (#1653)
by Aristeides
05:03 queued 02:40
created

Kirki_Field_Dimension::sanitize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Override field methods
4
 *
5
 * @package     Kirki
6
 * @subpackage  Controls
7
 * @copyright   Copyright (c) 2017, Aristeides Stathopoulos
8
 * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
9
 * @since       2.3.2
10
 */
11
12
/**
13
 * Field overrides.
14
 */
15
class Kirki_Field_Dimension extends Kirki_Field {
16
17
	/**
18
	 * Sets the control type.
19
	 *
20
	 * @access protected
21
	 */
22
	protected function set_type() {
23
24
		$this->type = 'kirki-dimension';
25
26
	}
27
28
	/**
29
	 * Sanitizes the value.
30
	 *
31
	 * @access public
32
	 * @param string $value The value.
33
	 * @return string
34
	 */
35
	public function sanitize( $value ) {
36
		return Kirki_Sanitize_Values::css_dimension( $value );
37
	}
38
}
39