Kirki_Field_Spacing   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A set_choices() 0 17 1
1
<?php
2
/**
3
 * Override field methods
4
 *
5
 * @package     Kirki
6
 * @subpackage  Controls
7
 * @copyright   Copyright (c) 2017, Aristeides Stathopoulos
8
 * @license    https://opensource.org/licenses/MIT
9
 * @since       2.2.7
10
 */
11
12
/**
13
 * Field overrides.
14
 */
15
class Kirki_Field_Spacing extends Kirki_Field_Dimensions {
16
17
	/**
18
	 * Set the choices.
19
	 * Adds a pseudo-element "controls" that helps with the JS API.
20
	 *
21
	 * @access protected
22
	 */
23
	protected function set_choices() {
24
		$default_args = array(
25
			'controls' => array(
26
				'top'    => ( isset( $this->default['top'] ) ),
27
				'bottom' => ( isset( $this->default['top'] ) ),
28
				'left'   => ( isset( $this->default['top'] ) ),
29
				'right'  => ( isset( $this->default['top'] ) ),
30
			),
31
			'labels'   => array(
32
				'top'    => esc_html__( 'Top', 'kirki' ),
33
				'bottom' => esc_html__( 'Bottom', 'kirki' ),
34
				'left'   => esc_html__( 'Left', 'kirki' ),
35
				'right'  => esc_html__( 'Right', 'kirki' ),
36
			),
37
		);
38
39
		$this->choices = wp_parse_args( $this->choices, $default_args );
40
	}
41
}
42