Completed
Pull Request — develop (#1319)
by Aristeides
03:53 queued 01:19
created

Kirki_Panels_Nested_Panel   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A json() 0 17 1
1
<?php
2
/**
3
 * Nested section.
4
 *
5
 * @package     Kirki
6
 * @subpackage  Custom Sections Module
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
 * Nested panel.
14
 */
15
class Kirki_Panels_Nested_Panel extends WP_Customize_Panel {
16
17
	/**
18
	 * The parent panel.
19
	 *
20
	 * @access public
21
	 * @since 3.0.0
22
	 * @var string
23
	 */
24
	public $panel;
25
26
	/**
27
	 * Type of this panel.
28
	 *
29
	 * @access public
30
	 * @since 3.0.0
31
	 * @var string
32
	 */
33
	public $type = 'kirki-nested';
34
35
	/**
36
	 * Gather the parameters passed to client JavaScript via JSON.
37
	 *
38
	 * @access public
39
	 * @since 3.0.0
40
	 * @return array The array to be exported to the client as JSON.
41
	 */
42
	public function json() {
43
44
		$array = wp_array_slice_assoc( (array) $this, array(
45
			'id',
46
			'description',
47
			'priority',
48
			'type',
49
			'panel',
50
		));
51
52
		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
53
		$array['content']        = $this->get_content();
54
		$array['active']         = $this->active();
55
		$array['instanceNumber'] = $this->instance_number;
56
57
		return $array;
58
	}
59
}
60