Completed
Pull Request — develop (#1311)
by Aristeides
03:09
created

Kirki_Field_Gradient::set_choices()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 10
nc 2
nop 0
dl 0
loc 17
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       2.2.7
10
 */
11
12
/**
13
 * Field overrides.
14
 */
15
class Kirki_Field_Gradient extends Kirki_Field_Color {
16
17
	/**
18
	 * Sets the control type.
19
	 *
20
	 * @access protected
21
	 */
22
	protected function set_type() {
23
24
		$this->type = 'kirki-gradient';
25
26
	}
27
28
	/**
29
	 * Sets the $choices
30
	 *
31
	 * @access protected
32
	 */
33
	protected function set_choices() {
34
35
		if ( ! is_array( $this->choices ) ) {
36
			$this->choices = array();
37
		}
38
39
		$defaults = array(
40
			'alpha'     => true,
41
			'direction' => 'top-to-bottom',
42
			'colors'    => array(
43
				'rgba(255,255,255,0)',
44
				'rgba(255,255,255,0)'
0 ignored issues
show
introduced by
Comma required after last value in array declaration
Loading history...
45
			),
46
		);
47
		$this->choices = wp_parse_args( $this->choices, $defaults );
48
49
	}
50
}
51