Passed
Pull Request — master (#1889)
by Aristeides
03:44
created

Kirki_Field_Preset::set_multiple()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
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.2.7
10
 */
11
12
/**
13
 * Field overrides.
14
 */
15
class Kirki_Field_Preset extends Kirki_Field_Select {
16
17
	/**
18
	 * Sets the control type.
19
	 *
20
	 * @access protected
21
	 */
22
	protected function set_type() {
23
24
		$this->type = 'kirki-select';
25
26
	}
27
28
	/**
29
	 * Set the preset.
30
	 *
31
	 * @access protected
32
	 * @since 3.0.28
33
	 */
34
	protected function set_preset() {
35
36
		// Set preset from the choices.
37
		$this->preset = $this->choices;
38
39
		// We're using a flat select.
40
		foreach ( $this->choices as $key => $args ) {
41
			$this->choices[ $key ] = $args['label'];
42
		}
43
	}
44
}
45