Completed
Pull Request — develop (#1313)
by Aristeides
04:59
created

Kirki_Field_FontAwesome::set_sanitize_callback()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Override field methods
4
 *
5
 * @package     Kirki
6
 * @subpackage  Controls
7
 * @copyright   Copyright (c) 2016, Aristeides Stathopoulos
8
 * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
9
 * @since       3.0.0
10
 */
11
12
/**
13
 * Field overrides.
14
 */
15
class Kirki_Field_FontAwesome 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-fontawesome';
25
26
	}
27
28
	/**
29
	 * Sets the $sanitize_callback
30
	 *
31
	 * @access protected
32
	 */
33
	protected function set_sanitize_callback() {
34
35
		// If a custom sanitize_callback has been defined,
36
		// then we don't need to proceed any further.
37
		if ( ! empty( $this->sanitize_callback ) ) {
38
			return;
39
		}
40
		$this->sanitize_callback = 'esc_attr';
41
42
	}
43
}
44