Passed
Push — main ( 137754...ffd9e1 )
by TARIQ
04:53
created
kirki-framework/control-react-colorful/src/Control/ReactColorful.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 use Kirki\URL;
15 15
 
16 16
 // Exit if accessed directly.
17
-if ( ! defined( 'ABSPATH' ) ) {
17
+if (!defined('ABSPATH')) {
18 18
 	exit;
19 19
 }
20 20
 
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
 		parent::enqueue();
67 67
 
68 68
 		// Enqueue the script.
69
-		wp_enqueue_script( 'kirki-control-react-colorful', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'customize-controls', 'wp-element', 'jquery', 'customize-base', 'kirki-control-base' ], self::$control_ver, false );
69
+		wp_enqueue_script('kirki-control-react-colorful', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.js'), ['customize-controls', 'wp-element', 'jquery', 'customize-base', 'kirki-control-base'], self::$control_ver, false);
70 70
 
71 71
 		// Enqueue the style.
72
-		wp_enqueue_style( 'kirki-control-react-colorful', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver );
72
+		wp_enqueue_style('kirki-control-react-colorful', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.css'), [], self::$control_ver);
73 73
 
74 74
 	}
75 75
 
@@ -86,32 +86,32 @@  discard block
 block discarded – undo
86 86
 		// Get the basics from the parent class.
87 87
 		parent::to_json();
88 88
 
89
-		if ( isset( $this->json['label'] ) ) {
90
-			$this->json['label'] = html_entity_decode( $this->json['label'] );
89
+		if (isset($this->json['label'])) {
90
+			$this->json['label'] = html_entity_decode($this->json['label']);
91 91
 		}
92 92
 
93
-		if ( isset( $this->json['description'] ) ) {
94
-			$this->json['description'] = html_entity_decode( $this->json['description'] );
93
+		if (isset($this->json['description'])) {
94
+			$this->json['description'] = html_entity_decode($this->json['description']);
95 95
 		}
96 96
 
97 97
 		// Value.
98
-		$this->json['value'] = empty( $this->value() ) ? '' : ( 'hue' === $this->mode ? absint( $this->value() ) : $this->value() );
98
+		$this->json['value'] = empty($this->value()) ? '' : ('hue' === $this->mode ? absint($this->value()) : $this->value());
99 99
 
100
-		if ( is_string( $this->json['value'] ) ) {
101
-			$this->json['value'] = strtolower( $this->json['value'] );
100
+		if (is_string($this->json['value'])) {
101
+			$this->json['value'] = strtolower($this->json['value']);
102 102
 		}
103 103
 
104 104
 		// Mode.
105 105
 		$this->json['mode'] = $this->mode;
106 106
 
107 107
 		// The label_style.
108
-		$this->json['choices']['labelStyle'] = isset( $this->choices['label_style'] ) ? $this->choices['label_style'] : 'default';
108
+		$this->json['choices']['labelStyle'] = isset($this->choices['label_style']) ? $this->choices['label_style'] : 'default';
109 109
 
110 110
 		// Color swatches.
111 111
 		$this->json['choices']['swatches'] = $this->color_swatches();
112 112
 
113 113
 		// Form component (the value is bsaed on react-colorful's components).
114
-		if ( isset( $this->choices['form_component'] ) ) {
114
+		if (isset($this->choices['form_component'])) {
115 115
 			$this->json['choices']['formComponent'] = $this->choices['form_component'];
116 116
 		}
117 117
 
@@ -130,20 +130,20 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function remove_unused_json_props() {
132 132
 
133
-		if ( isset( $this->json['choices']['label_style'] ) ) {
134
-			unset( $this->json['choices']['label_style'] );
133
+		if (isset($this->json['choices']['label_style'])) {
134
+			unset($this->json['choices']['label_style']);
135 135
 		}
136 136
 
137
-		if ( isset( $this->choices['form_component'] ) ) {
138
-			unset( $this->json['choices']['form_component'] );
137
+		if (isset($this->choices['form_component'])) {
138
+			unset($this->json['choices']['form_component']);
139 139
 		}
140 140
 
141
-		if ( isset( $this->json['choices']['trigger_style'] ) ) {
142
-			unset( $this->json['choices']['trigger_style'] );
141
+		if (isset($this->json['choices']['trigger_style'])) {
142
+			unset($this->json['choices']['trigger_style']);
143 143
 		}
144 144
 
145
-		if ( isset( $this->json['choices']['button_text'] ) ) {
146
-			unset( $this->json['choices']['button_text'] );
145
+		if (isset($this->json['choices']['button_text'])) {
146
+			unset($this->json['choices']['button_text']);
147 147
 		}
148 148
 
149 149
 	}
@@ -166,28 +166,28 @@  discard block
 block discarded – undo
166 166
 			'#8224e3',
167 167
 		];
168 168
 
169
-		$default_swatches = apply_filters( 'kirki_default_color_swatches', $default_swatches );
169
+		$default_swatches = apply_filters('kirki_default_color_swatches', $default_swatches);
170 170
 
171
-		$defined_swatches = isset( $this->choices['swatches'] ) && ! empty( $this->choices['swatches'] ) ? $this->choices['swatches'] : [];
171
+		$defined_swatches = isset($this->choices['swatches']) && !empty($this->choices['swatches']) ? $this->choices['swatches'] : [];
172 172
 
173
-		if ( empty( $defined_swatches ) ) {
174
-			$defined_swatches = isset( $this->choices['palettes'] ) && ! empty( $this->choices['palettes'] ) ? $this->choices['palettes'] : [];
173
+		if (empty($defined_swatches)) {
174
+			$defined_swatches = isset($this->choices['palettes']) && !empty($this->choices['palettes']) ? $this->choices['palettes'] : [];
175 175
 		}
176 176
 
177
-		if ( ! empty( $defined_swatches ) ) {
177
+		if (!empty($defined_swatches)) {
178 178
 			$swatches       = $defined_swatches;
179
-			$total_swatches = count( $swatches );
179
+			$total_swatches = count($swatches);
180 180
 
181
-			if ( $total_swatches < 8 ) {
182
-				for ( $i = $total_swatches; $i <= 8; $i++ ) {
183
-					$swatches[] = $total_swatches[ $i ];
181
+			if ($total_swatches < 8) {
182
+				for ($i = $total_swatches; $i <= 8; $i++) {
183
+					$swatches[] = $total_swatches[$i];
184 184
 				}
185 185
 			}
186 186
 		} else {
187 187
 			$swatches = $default_swatches;
188 188
 		}
189 189
 
190
-		$swatches = apply_filters( 'kirki_color_swatches', $swatches );
190
+		$swatches = apply_filters('kirki_color_swatches', $swatches);
191 191
 
192 192
 		return $swatches;
193 193
 
Please login to merge, or discard this patch.
packages/kirki-framework/control-repeater/src/Field/Repeater.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	protected function set_sanitize_callback() {
79 79
 
80
-		if ( empty( $this->sanitize_callback ) ) {
81
-			$this->sanitize_callback = [ $this, 'sanitize' ];
80
+		if (empty($this->sanitize_callback)) {
81
+			$this->sanitize_callback = [$this, 'sanitize'];
82 82
 		}
83 83
 
84 84
 	}
@@ -90,108 +90,108 @@  discard block
 block discarded – undo
90 90
 	 * @since 1.0
91 91
 	 * @param string|array $value The control's value.
92 92
 	 */
93
-	public function sanitize( $value ) {
93
+	public function sanitize($value) {
94 94
 
95 95
 		// is the value formatted as a string?
96
-		if ( is_string( $value ) ) {
97
-			$value = rawurldecode( $value );
98
-			$value = json_decode( $value, true );
96
+		if (is_string($value)) {
97
+			$value = rawurldecode($value);
98
+			$value = json_decode($value, true);
99 99
 		}
100 100
 
101 101
 		// Nothing to sanitize if we don't have fields.
102
-		if ( empty( $this->fields ) ) {
102
+		if (empty($this->fields)) {
103 103
 			return $value;
104 104
 		}
105 105
 
106
-		foreach ( $value as $row_id => $row_value ) {
106
+		foreach ($value as $row_id => $row_value) {
107 107
 
108 108
 			// Make sure the row is formatted as an array.
109
-			if ( ! is_array( $row_value ) ) {
110
-				$value[ $row_id ] = [];
109
+			if (!is_array($row_value)) {
110
+				$value[$row_id] = [];
111 111
 				continue;
112 112
 			}
113 113
 
114 114
 			// Start parsing sub-fields in rows.
115
-			foreach ( $row_value as $subfield_id => $subfield_value ) {
115
+			foreach ($row_value as $subfield_id => $subfield_value) {
116 116
 
117 117
 				// Make sure this is a valid subfield.
118 118
 				// If it's not, then unset it.
119
-				if ( ! isset( $this->fields[ $subfield_id ] ) ) {
120
-					unset( $value[ $row_id ][ $subfield_id ] );
119
+				if (!isset($this->fields[$subfield_id])) {
120
+					unset($value[$row_id][$subfield_id]);
121 121
 				}
122 122
 
123 123
 				// Get the subfield-type.
124
-				if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) {
124
+				if (!isset($this->fields[$subfield_id]['type'])) {
125 125
 					continue;
126 126
 				}
127 127
 
128
-				$subfield      = $this->fields[ $subfield_id ];
128
+				$subfield      = $this->fields[$subfield_id];
129 129
 				$subfield_type = $subfield['type'];
130 130
 
131 131
 				// Allow using a sanitize-callback on a per-field basis.
132
-				if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) {
133
-					$subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value );
132
+				if (isset($this->fields[$subfield_id]['sanitize_callback'])) {
133
+					$subfield_value = call_user_func($this->fields[$subfield_id]['sanitize_callback'], $subfield_value);
134 134
 				} else {
135 135
 
136
-					switch ( $subfield_type ) {
136
+					switch ($subfield_type) {
137 137
 						case 'image':
138 138
 						case 'cropped_image':
139 139
 						case 'upload':
140
-							$save_as        = isset( $subfield['choices'] ) && isset( $subfield['choices']['save_as'] ) ? $subfield['choices']['save_as'] : 'url';
141
-							$subfield_value = Upload::sanitize( $subfield_value, $save_as );
140
+							$save_as        = isset($subfield['choices']) && isset($subfield['choices']['save_as']) ? $subfield['choices']['save_as'] : 'url';
141
+							$subfield_value = Upload::sanitize($subfield_value, $save_as);
142 142
 
143 143
 							break;
144 144
 						case 'dropdown-pages':
145 145
 							$subfield_value = (int) $subfield_value;
146 146
 							break;
147 147
 						case 'color':
148
-							if ( $subfield_value ) {
149
-								$subfield_value = \Kirki\Field\ReactColorful::sanitize( $subfield_value );
148
+							if ($subfield_value) {
149
+								$subfield_value = \Kirki\Field\ReactColorful::sanitize($subfield_value);
150 150
 							}
151 151
 							break;
152 152
 						case 'text':
153
-							$subfield_value = sanitize_text_field( $subfield_value );
153
+							$subfield_value = sanitize_text_field($subfield_value);
154 154
 							break;
155 155
 						case 'url':
156 156
 						case 'link':
157
-							$subfield_value = esc_url_raw( $subfield_value );
157
+							$subfield_value = esc_url_raw($subfield_value);
158 158
 							break;
159 159
 						case 'email':
160
-							$subfield_value = filter_var( $subfield_value, FILTER_SANITIZE_EMAIL );
160
+							$subfield_value = filter_var($subfield_value, FILTER_SANITIZE_EMAIL);
161 161
 							break;
162 162
 						case 'tel':
163
-							$subfield_value = sanitize_text_field( $subfield_value );
163
+							$subfield_value = sanitize_text_field($subfield_value);
164 164
 							break;
165 165
 						case 'checkbox':
166 166
 							$subfield_value = (bool) $subfield_value;
167 167
 							break;
168 168
 						case 'select':
169
-							if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) {
170
-								if ( true === $this->fields[ $subfield_id ]['multiple'] ) {
169
+							if (isset($this->fields[$subfield_id]['multiple'])) {
170
+								if (true === $this->fields[$subfield_id]['multiple']) {
171 171
 									$multiple = 2;
172 172
 								}
173
-								$multiple = (int) $this->fields[ $subfield_id ]['multiple'];
174
-								if ( 1 < $multiple ) {
173
+								$multiple = (int) $this->fields[$subfield_id]['multiple'];
174
+								if (1 < $multiple) {
175 175
 									$subfield_value = (array) $subfield_value;
176
-									foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) {
177
-										$subfield_value[ $sub_subfield_key ] = sanitize_text_field( $sub_subfield_value );
176
+									foreach ($subfield_value as $sub_subfield_key => $sub_subfield_value) {
177
+										$subfield_value[$sub_subfield_key] = sanitize_text_field($sub_subfield_value);
178 178
 									}
179 179
 								} else {
180
-									$subfield_value = sanitize_text_field( $subfield_value );
180
+									$subfield_value = sanitize_text_field($subfield_value);
181 181
 								}
182 182
 							}
183 183
 							break;
184 184
 						case 'radio':
185 185
 						case 'radio-image':
186
-							$subfield_value = sanitize_text_field( $subfield_value );
186
+							$subfield_value = sanitize_text_field($subfield_value);
187 187
 							break;
188 188
 						case 'textarea':
189
-							$subfield_value = html_entity_decode( wp_kses_post( $subfield_value ) );
189
+							$subfield_value = html_entity_decode(wp_kses_post($subfield_value));
190 190
 
191 191
 					}
192 192
 				}
193 193
 
194
-				$value[ $row_id ][ $subfield_id ] = $subfield_value;
194
+				$value[$row_id][$subfield_id] = $subfield_value;
195 195
 			}
196 196
 		}
197 197
 
Please login to merge, or discard this patch.
packages/kirki-framework/control-repeater/src/Settings/Repeater.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 	 * @param string               $id       A specific ID of the setting. Can be a theme mod or option name.
27 27
 	 * @param array                $args     Setting arguments.
28 28
 	 */
29
-	public function __construct( $manager, $id, $args = [] ) {
30
-		parent::__construct( $manager, $id, $args );
29
+	public function __construct($manager, $id, $args = []) {
30
+		parent::__construct($manager, $id, $args);
31 31
 
32 32
 		// Will convert the setting from JSON to array. Must be triggered very soon.
33
-		add_filter( "customize_sanitize_{$this->id}", [ $this, 'sanitize_repeater_setting' ], 10, 1 );
33
+		add_filter("customize_sanitize_{$this->id}", [$this, 'sanitize_repeater_setting'], 10, 1);
34 34
 	}
35 35
 
36 36
 	/**
@@ -52,26 +52,26 @@  discard block
 block discarded – undo
52 52
 	 * @param string $value URL Encoded JSON Value.
53 53
 	 * @return array
54 54
 	 */
55
-	public function sanitize_repeater_setting( $value ) {
56
-		if ( ! is_array( $value ) ) {
57
-			$value = json_decode( urldecode( $value ) );
55
+	public function sanitize_repeater_setting($value) {
56
+		if (!is_array($value)) {
57
+			$value = json_decode(urldecode($value));
58 58
 		}
59 59
 
60
-		if ( empty( $value ) || ! is_array( $value ) ) {
60
+		if (empty($value) || !is_array($value)) {
61 61
 			$value = [];
62 62
 		}
63 63
 
64 64
 		// Make sure that every row is an array, not an object.
65
-		foreach ( $value as $key => $val ) {
66
-			$value[ $key ] = (array) $val;
67
-			if ( empty( $val ) ) {
68
-				unset( $value[ $key ] );
65
+		foreach ($value as $key => $val) {
66
+			$value[$key] = (array) $val;
67
+			if (empty($val)) {
68
+				unset($value[$key]);
69 69
 			}
70 70
 		}
71 71
 
72 72
 		// Reindex array.
73
-		if ( is_array( $value ) ) {
74
-			$value = array_values( $value );
73
+		if (is_array($value)) {
74
+			$value = array_values($value);
75 75
 		}
76 76
 
77 77
 		return $value;
Please login to merge, or discard this patch.
packages/kirki-framework/control-repeater/src/Control/Repeater.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -85,49 +85,49 @@  discard block
 block discarded – undo
85 85
 	 * @param string               $id      Control ID.
86 86
 	 * @param array                $args    {@see WP_Customize_Control::__construct}.
87 87
 	 */
88
-	public function __construct( $manager, $id, $args = [] ) {
88
+	public function __construct($manager, $id, $args = []) {
89 89
 
90
-		parent::__construct( $manager, $id, $args );
90
+		parent::__construct($manager, $id, $args);
91 91
 
92 92
 		// Set up defaults for row labels.
93 93
 		$this->row_label = [
94 94
 			'type'  => 'text',
95
-			'value' => esc_attr__( 'row', 'kirki' ),
95
+			'value' => esc_attr__('row', 'kirki'),
96 96
 			'field' => false,
97 97
 		];
98 98
 
99 99
 		// Validate row-labels.
100
-		$this->row_label( $args );
100
+		$this->row_label($args);
101 101
 
102
-		if ( empty( $this->button_label ) ) {
102
+		if (empty($this->button_label)) {
103 103
 			/* translators: %s represents the label of the row. */
104
-			$this->button_label = sprintf( esc_html__( 'Add new %s', 'kirki' ), $this->row_label['value'] );
104
+			$this->button_label = sprintf(esc_html__('Add new %s', 'kirki'), $this->row_label['value']);
105 105
 		}
106 106
 
107
-		if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) {
107
+		if (empty($args['fields']) || !is_array($args['fields'])) {
108 108
 			$args['fields'] = [];
109 109
 		}
110 110
 
111 111
 		// An array to store keys of fields that need to be filtered.
112 112
 		$media_fields_to_filter = [];
113 113
 
114
-		foreach ( $args['fields'] as $key => $value ) {
115
-			if ( ! isset( $value['default'] ) ) {
116
-				$args['fields'][ $key ]['default'] = '';
114
+		foreach ($args['fields'] as $key => $value) {
115
+			if (!isset($value['default'])) {
116
+				$args['fields'][$key]['default'] = '';
117 117
 			}
118
-			if ( ! isset( $value['label'] ) ) {
119
-				$args['fields'][ $key ]['label'] = '';
118
+			if (!isset($value['label'])) {
119
+				$args['fields'][$key]['label'] = '';
120 120
 			}
121
-			$args['fields'][ $key ]['id'] = $key;
121
+			$args['fields'][$key]['id'] = $key;
122 122
 
123 123
 			// We check if the filed is an uploaded media ( image , file, video, etc.. ).
124
-			if ( isset( $value['type'] ) ) {
125
-				switch ( $value['type'] ) {
124
+			if (isset($value['type'])) {
125
+				switch ($value['type']) {
126 126
 					case 'image':
127 127
 					case 'cropped_image':
128 128
 					case 'upload':
129 129
 						// We add it to the list of fields that need some extra filtering/processing.
130
-						$media_fields_to_filter[ $key ] = true;
130
+						$media_fields_to_filter[$key] = true;
131 131
 						break;
132 132
 
133 133
 					case 'dropdown-pages':
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 							[
137 137
 								'name'              => '',
138 138
 								'echo'              => 0,
139
-								'show_option_none'  => esc_html__( 'Select a Page', 'kirki' ),
139
+								'show_option_none'  => esc_html__('Select a Page', 'kirki'),
140 140
 								'option_none_value' => '0',
141 141
 								'selected'          => '',
142 142
 							]
143 143
 						);
144 144
 
145 145
 						// Hackily add in the data link parameter.
146
-						$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment
147
-						$args['fields'][ $key ]['dropdown'] = $dropdown;
146
+						$dropdown = str_replace('<select', '<select data-field="' . esc_attr($args['fields'][$key]['id']) . '"' . $this->get_link(), $dropdown); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment
147
+						$args['fields'][$key]['dropdown'] = $dropdown;
148 148
 						break;
149 149
 				}
150 150
 			}
@@ -156,34 +156,34 @@  discard block
 block discarded – undo
156 156
 		// First we create a copy of the value that would be used otherwise.
157 157
 		$this->filtered_value = $this->value();
158 158
 
159
-		if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) {
159
+		if (is_array($this->filtered_value) && !empty($this->filtered_value)) {
160 160
 
161 161
 			// We iterate over the list of fields.
162
-			foreach ( $this->filtered_value as &$filtered_value_field ) {
162
+			foreach ($this->filtered_value as &$filtered_value_field) {
163 163
 
164
-				if ( is_array( $filtered_value_field ) && ! empty( $filtered_value_field ) ) {
164
+				if (is_array($filtered_value_field) && !empty($filtered_value_field)) {
165 165
 
166 166
 					// We iterate over the list of properties for this field.
167
-					foreach ( $filtered_value_field as $key => &$value ) {
167
+					foreach ($filtered_value_field as $key => &$value) {
168 168
 
169 169
 						// We check if this field was marked as requiring extra filtering (in this case image, cropped_images, upload).
170
-						if ( array_key_exists( $key, $media_fields_to_filter ) ) {
170
+						if (array_key_exists($key, $media_fields_to_filter)) {
171 171
 
172 172
 							// What follows was made this way to preserve backward compatibility.
173 173
 							// The repeater control use to store the URL for images instead of the attachment ID.
174 174
 							// We check if the value look like an ID (otherwise it's probably a URL so don't filter it).
175
-							if ( is_numeric( $value ) ) {
175
+							if (is_numeric($value)) {
176 176
 
177 177
 								// "sanitize" the value.
178 178
 								$attachment_id = (int) $value;
179 179
 
180 180
 								// Try to get the attachment_url.
181
-								$url = wp_get_attachment_url( $attachment_id );
181
+								$url = wp_get_attachment_url($attachment_id);
182 182
 
183
-								$filename = basename( get_attached_file( $attachment_id ) );
183
+								$filename = basename(get_attached_file($attachment_id));
184 184
 
185 185
 								// If we got a URL.
186
-								if ( $url ) {
186
+								if ($url) {
187 187
 
188 188
 									// 'id' is needed for form hidden value, URL is needed to display the image.
189 189
 									$value = [
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
 		parent::enqueue();
214 214
 
215 215
 		// Enqueue the style.
216
-		wp_enqueue_style( 'wp-color-picker' );
217
-		wp_enqueue_style( 'kirki-control-repeater-style', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver );
216
+		wp_enqueue_style('wp-color-picker');
217
+		wp_enqueue_style('kirki-control-repeater-style', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.css'), [], self::$control_ver);
218 218
 
219 219
 		// Enqueue the script.
220
-		wp_enqueue_script( 'wp-color-picker-alpha', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/wp-color-picker-alpha.min.js' ), array( 'jquery', 'customize-base', 'wp-color-picker' ), self::$control_ver, false );
221
-		wp_enqueue_script( 'kirki-control-repeater', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'wp-color-picker-alpha' ], self::$control_ver, false );
220
+		wp_enqueue_script('wp-color-picker-alpha', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/wp-color-picker-alpha.min.js'), array('jquery', 'customize-base', 'wp-color-picker'), self::$control_ver, false);
221
+		wp_enqueue_script('kirki-control-repeater', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.js'), ['wp-color-picker-alpha'], self::$control_ver, false);
222 222
 
223 223
 	}
224 224
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
 		$this->json['row_label'] = $this->row_label;
240 240
 
241 241
 		// If filtered_value has been set and is not empty we use it instead of the actual value.
242
-		if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) {
242
+		if (is_array($this->filtered_value) && !empty($this->filtered_value)) {
243 243
 			$this->json['value'] = $this->filtered_value;
244 244
 		}
245 245
 
246
-		$this->json['value'] = apply_filters( "kirki_controls_repeater_value_{$this->id}", $this->json['value'] );
246
+		$this->json['value'] = apply_filters("kirki_controls_repeater_value_{$this->id}", $this->json['value']);
247 247
 
248 248
 	}
249 249
 
@@ -259,22 +259,22 @@  discard block
 block discarded – undo
259 259
 
260 260
 		?>
261 261
 		<label>
262
-			<?php if ( ! empty( $this->label ) ) : ?>
263
-				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
262
+			<?php if (!empty($this->label)) : ?>
263
+				<span class="customize-control-title"><?php echo esc_html($this->label); ?></span>
264 264
 			<?php endif; ?>
265
-			<?php if ( ! empty( $this->description ) ) : ?>
266
-				<span class="description customize-control-description"><?php echo wp_kses_post( $this->description ); ?></span>
265
+			<?php if (!empty($this->description)) : ?>
266
+				<span class="description customize-control-description"><?php echo wp_kses_post($this->description); ?></span>
267 267
 			<?php endif; ?>
268
-			<input type="hidden" {{{ data.inputAttrs }}} value="" <?php echo wp_kses_post( $this->get_link() ); ?> />
268
+			<input type="hidden" {{{ data.inputAttrs }}} value="" <?php echo wp_kses_post($this->get_link()); ?> />
269 269
 		</label>
270 270
 
271 271
 		<ul class="repeater-fields"></ul>
272 272
 
273
-		<?php if ( isset( $this->choices['limit'] ) ) : ?>
273
+		<?php if (isset($this->choices['limit'])) : ?>
274 274
 			<?php /* translators: %s represents the number of rows we're limiting the repeater to allow. */ ?>
275
-			<p class="limit"><?php printf( esc_html__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices['limit'] ) ); ?></p>
275
+			<p class="limit"><?php printf(esc_html__('Limit: %s rows', 'kirki'), esc_html($this->choices['limit'])); ?></p>
276 276
 		<?php endif; ?>
277
-		<button class="button-secondary repeater-add"><?php echo esc_html( $this->button_label ); ?></button>
277
+		<button class="button-secondary repeater-add"><?php echo esc_html($this->button_label); ?></button>
278 278
 
279 279
 		<?php
280 280
 		$this->repeater_js_template();
@@ -440,22 +440,22 @@  discard block
 block discarded – undo
440 440
 									<# if ( field.description ) { #><span class="description customize-control-description">{{{ field.description }}}</span><# } #>
441 441
 								</label>
442 442
 
443
-								<figure class="kirki-image-attachment" data-placeholder="<?php esc_attr_e( 'No Image Selected', 'kirki' ); ?>" >
443
+								<figure class="kirki-image-attachment" data-placeholder="<?php esc_attr_e('No Image Selected', 'kirki'); ?>" >
444 444
 									<# if ( field.default ) { #>
445 445
 										<# var defaultImageURL = ( field.default.url ) ? field.default.url : field.default; #>
446 446
 										<img src="{{{ defaultImageURL }}}">
447 447
 									<# } else { #>
448
-										<?php esc_html_e( 'No Image Selected', 'kirki' ); ?>
448
+										<?php esc_html_e('No Image Selected', 'kirki'); ?>
449 449
 									<# } #>
450 450
 								</figure>
451 451
 
452 452
 								<div class="actions">
453
-									<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_html_e( 'Remove', 'kirki' ); ?></button>
454
-									<button type="button" class="button upload-button" data-label=" <?php esc_attr_e( 'Add Image', 'kirki' ); ?>" data-alt-label="<?php echo esc_attr_e( 'Change Image', 'kirki' ); ?>" >
453
+									<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_html_e('Remove', 'kirki'); ?></button>
454
+									<button type="button" class="button upload-button" data-label=" <?php esc_attr_e('Add Image', 'kirki'); ?>" data-alt-label="<?php echo esc_attr_e('Change Image', 'kirki'); ?>" >
455 455
 										<# if ( field.default ) { #>
456
-											<?php esc_html_e( 'Change Image', 'kirki' ); ?>
456
+											<?php esc_html_e('Change Image', 'kirki'); ?>
457 457
 										<# } else { #>
458
-											<?php esc_html_e( 'Add Image', 'kirki' ); ?>
458
+											<?php esc_html_e('Add Image', 'kirki'); ?>
459 459
 										<# } #>
460 460
 									</button>
461 461
 									<# if ( field.default.id ) { #>
@@ -472,22 +472,22 @@  discard block
 block discarded – undo
472 472
 									<# if ( field.description ) { #><span class="description customize-control-description">{{{ field.description }}}</span><# } #>
473 473
 								</label>
474 474
 
475
-								<figure class="kirki-file-attachment" data-placeholder="<?php esc_attr_e( 'No File Selected', 'kirki' ); ?>" >
475
+								<figure class="kirki-file-attachment" data-placeholder="<?php esc_attr_e('No File Selected', 'kirki'); ?>" >
476 476
 									<# if ( field.default ) { #>
477 477
 										<# var defaultFilename = ( field.default.filename ) ? field.default.filename : field.default; #>
478 478
 										<span class="file"><span class="dashicons dashicons-media-default"></span> {{ defaultFilename }}</span>
479 479
 									<# } else { #>
480
-										<?php esc_html_e( 'No File Selected', 'kirki' ); ?>
480
+										<?php esc_html_e('No File Selected', 'kirki'); ?>
481 481
 									<# } #>
482 482
 								</figure>
483 483
 
484 484
 								<div class="actions">
485
-									<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_html_e( 'Remove', 'kirki' ); ?></button>
486
-									<button type="button" class="button upload-button" data-label="<?php esc_attr_e( 'Add File', 'kirki' ); ?>" data-alt-label="<?php esc_attr_e( 'Change File', 'kirki' ); ?>">
485
+									<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_html_e('Remove', 'kirki'); ?></button>
486
+									<button type="button" class="button upload-button" data-label="<?php esc_attr_e('Add File', 'kirki'); ?>" data-alt-label="<?php esc_attr_e('Change File', 'kirki'); ?>">
487 487
 										<# if ( field.default ) { #>
488
-											<?php esc_html_e( 'Change File', 'kirki' ); ?>
488
+											<?php esc_html_e('Change File', 'kirki'); ?>
489 489
 										<# } else { #>
490
-											<?php esc_html_e( 'Add File', 'kirki' ); ?>
490
+											<?php esc_html_e('Add File', 'kirki'); ?>
491 491
 										<# } #>
492 492
 									</button>
493 493
 									<# if ( field.default.id ) { #>
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 
508 508
 						</div>
509 509
 					<# }); #>
510
-					<button type="button" class="button-link repeater-row-remove"><?php esc_html_e( 'Remove', 'kirki' ); ?></button>
510
+					<button type="button" class="button-link repeater-row-remove"><?php esc_html_e('Remove', 'kirki'); ?></button>
511 511
 				</div>
512 512
 			</li>
513 513
 		</script>
@@ -523,24 +523,24 @@  discard block
 block discarded – undo
523 523
 	 * @param array $args {@see WP_Customize_Control::__construct}.
524 524
 	 * @return void
525 525
 	 */
526
-	protected function row_label( $args ) {
526
+	protected function row_label($args) {
527 527
 
528 528
 		// Validating args for row labels.
529
-		if ( isset( $args['row_label'] ) && is_array( $args['row_label'] ) && ! empty( $args['row_label'] ) ) {
529
+		if (isset($args['row_label']) && is_array($args['row_label']) && !empty($args['row_label'])) {
530 530
 
531 531
 			// Validating row label type.
532
-			if ( isset( $args['row_label']['type'] ) && ( 'text' === $args['row_label']['type'] || 'field' === $args['row_label']['type'] ) ) {
532
+			if (isset($args['row_label']['type']) && ('text' === $args['row_label']['type'] || 'field' === $args['row_label']['type'])) {
533 533
 				$this->row_label['type'] = $args['row_label']['type'];
534 534
 			}
535 535
 
536 536
 			// Validating row label type.
537
-			if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) {
538
-				$this->row_label['value'] = esc_html( $args['row_label']['value'] );
537
+			if (isset($args['row_label']['value']) && !empty($args['row_label']['value'])) {
538
+				$this->row_label['value'] = esc_html($args['row_label']['value']);
539 539
 			}
540 540
 
541 541
 			// Validating row label field.
542
-			if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ sanitize_key( $args['row_label']['field'] ) ] ) ) {
543
-				$this->row_label['field'] = esc_html( $args['row_label']['field'] );
542
+			if (isset($args['row_label']['field']) && !empty($args['row_label']['field']) && isset($args['fields'][sanitize_key($args['row_label']['field'])])) {
543
+				$this->row_label['field'] = esc_html($args['row_label']['field']);
544 544
 			} else {
545 545
 				// If from field is not set correctly, making sure standard is set as the type.
546 546
 				$this->row_label['type'] = 'text';
Please login to merge, or discard this patch.
packages/kirki-framework/module-postmessage/src/Postmessage.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @since 1.0.0
35 35
 	 */
36 36
 	public function __construct() {
37
-		add_action( 'customize_preview_init', [ $this, 'postmessage' ] );
38
-		add_action( 'kirki_field_add_setting_args', [ $this, 'field_add_setting_args' ] );
37
+		add_action('customize_preview_init', [$this, 'postmessage']);
38
+		add_action('kirki_field_add_setting_args', [$this, 'field_add_setting_args']);
39 39
 	}
40 40
 
41 41
 	/**
@@ -46,35 +46,35 @@  discard block
 block discarded – undo
46 46
 	 * @param array $args The field arguments.
47 47
 	 * @return array
48 48
 	 */
49
-	public function field_add_setting_args( $args ) {
49
+	public function field_add_setting_args($args) {
50 50
 
51
-		if ( ! isset( $args['transport'] ) ) {
51
+		if (!isset($args['transport'])) {
52 52
 			return $args;
53 53
 		}
54 54
 
55 55
 		$args['transport'] = 'auto' === $args['transport'] ? 'postMessage' : $args['transport'];
56 56
 
57
-		if ( 'postMessage' === $args['transport'] ) {
58
-			$args['js_vars'] = isset( $args['js_vars'] ) ? (array) $args['js_vars'] : [];
59
-			$args['output']  = isset( $args['output'] ) ? (array) $args['output'] : [];
57
+		if ('postMessage' === $args['transport']) {
58
+			$args['js_vars'] = isset($args['js_vars']) ? (array) $args['js_vars'] : [];
59
+			$args['output']  = isset($args['output']) ? (array) $args['output'] : [];
60 60
 			$js_vars         = $args['js_vars'];
61 61
 
62 62
 			// Try to auto-generate js_vars.
63 63
 			// First we need to check if js_vars are empty, and that output is not empty.
64
-			if ( empty( $args['js_vars'] ) && ! empty( $args['output'] ) ) {
64
+			if (empty($args['js_vars']) && !empty($args['output'])) {
65 65
 
66 66
 				// Convert to array of arrays if needed.
67
-				if ( isset( $args['output']['element'] ) ) {
67
+				if (isset($args['output']['element'])) {
68 68
 					/* translators: The field ID where the error occurs. */
69
-					_doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $args['settings'] ) ), '3.0.10' );
69
+					_doing_it_wrong(__METHOD__, sprintf(esc_html__('"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki'), esc_html($args['settings'])), '3.0.10');
70 70
 
71
-					$args['output'] = array( $args['output'] );
71
+					$args['output'] = array($args['output']);
72 72
 				}
73 73
 
74
-				foreach ( $args['output'] as $output ) {
75
-					$output['element']  = isset( $output['element'] ) ? $output['element'] : ':root';
76
-					$output['element']  = is_array( $output['element'] ) ? implode( ',', $output['element'] ) : $output['element'];
77
-					$output['function'] = isset( $output['function'] ) ? $output['function'] : 'style';
74
+				foreach ($args['output'] as $output) {
75
+					$output['element']  = isset($output['element']) ? $output['element'] : ':root';
76
+					$output['element']  = is_array($output['element']) ? implode(',', $output['element']) : $output['element'];
77
+					$output['function'] = isset($output['function']) ? $output['function'] : 'style';
78 78
 					$js_vars[]          = $output;
79 79
 				}
80 80
 			}
@@ -95,29 +95,29 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function postmessage() {
97 97
 
98
-		wp_enqueue_script( 'kirki_auto_postmessage', URL::get_from_path( __DIR__ . '/postMessage.js' ), [ 'jquery', 'customize-preview', 'wp-hooks' ], '1.0.6', true );
98
+		wp_enqueue_script('kirki_auto_postmessage', URL::get_from_path(__DIR__ . '/postMessage.js'), ['jquery', 'customize-preview', 'wp-hooks'], '1.0.6', true);
99 99
 
100 100
 		$fields = $this->fields;
101 101
 
102 102
 		// Compatibility with v3 API.
103
-		if ( class_exists( '\Kirki\Compatibility\Kirki' ) ) {
104
-			$fields = array_merge( \Kirki\Compatibility\Kirki::$fields, $fields );
103
+		if (class_exists('\Kirki\Compatibility\Kirki')) {
104
+			$fields = array_merge(\Kirki\Compatibility\Kirki::$fields, $fields);
105 105
 		}
106 106
 
107 107
 		$data = [];
108 108
 
109
-		foreach ( $fields as $field ) {
110
-			if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['js_vars'] ) && ! empty( $field['js_vars'] ) && is_array( $field['js_vars'] ) && isset( $field['settings'] ) ) {
109
+		foreach ($fields as $field) {
110
+			if (isset($field['transport']) && 'postMessage' === $field['transport'] && isset($field['js_vars']) && !empty($field['js_vars']) && is_array($field['js_vars']) && isset($field['settings'])) {
111 111
 				$data[] = $field;
112 112
 			}
113 113
 		}
114 114
 
115
-		wp_localize_script( 'kirki_auto_postmessage', 'kirkiPostMessageFields', $data );
115
+		wp_localize_script('kirki_auto_postmessage', 'kirkiPostMessageFields', $data);
116 116
 
117
-		$extras = apply_filters( 'kirki_postmessage_script', false );
117
+		$extras = apply_filters('kirki_postmessage_script', false);
118 118
 
119
-		if ( $extras ) {
120
-			wp_add_inline_script( 'kirki_auto_postmessage', $extras, 'after' );
119
+		if ($extras) {
120
+			wp_add_inline_script('kirki_auto_postmessage', $extras, 'after');
121 121
 		}
122 122
 
123 123
 	}
Please login to merge, or discard this patch.
packages/kirki-framework/control-dimension/src/Field/Dimension.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
54 54
 	 * @return array
55 55
 	 */
56
-	public function filter_setting_args( $args, $wp_customize ) {
57
-		if ( $args['settings'] === $this->args['settings'] ) {
58
-			$args = parent::filter_setting_args( $args, $wp_customize );
56
+	public function filter_setting_args($args, $wp_customize) {
57
+		if ($args['settings'] === $this->args['settings']) {
58
+			$args = parent::filter_setting_args($args, $wp_customize);
59 59
 
60 60
 			// Set the sanitize-callback if none is defined.
61
-			if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) {
61
+			if (!isset($args['sanitize_callback']) || !$args['sanitize_callback']) {
62 62
 				$args['sanitize_callback'] = 'sanitize_text_field';
63 63
 			}
64 64
 		}
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
75 75
 	 * @return array
76 76
 	 */
77
-	public function filter_control_args( $args, $wp_customize ) {
78
-		if ( $args['settings'] === $this->args['settings'] ) {
79
-			$args         = parent::filter_control_args( $args, $wp_customize );
77
+	public function filter_control_args($args, $wp_customize) {
78
+		if ($args['settings'] === $this->args['settings']) {
79
+			$args         = parent::filter_control_args($args, $wp_customize);
80 80
 			$args['type'] = 'kirki-dimension';
81 81
 		}
82 82
 		return $args;
Please login to merge, or discard this patch.
packages/kirki-framework/control-dimension/src/Control/Dimension.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 use Kirki\URL;
15 15
 
16 16
 // Exit if accessed directly.
17
-if ( ! defined( 'ABSPATH' ) ) {
17
+if (!defined('ABSPATH')) {
18 18
 	exit;
19 19
 }
20 20
 
@@ -55,16 +55,16 @@  discard block
 block discarded – undo
55 55
 		parent::enqueue();
56 56
 
57 57
 		// Enqueue the script.
58
-		wp_enqueue_script( 'kirki-control-dimension', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'kirki-control-base' ], self::$control_ver, false );
58
+		wp_enqueue_script('kirki-control-dimension', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.js'), ['jquery', 'customize-base', 'kirki-control-base'], self::$control_ver, false);
59 59
 
60 60
 		// Enqueue the style.
61
-		wp_enqueue_style( 'kirki-control-dimension-style', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver );
61
+		wp_enqueue_style('kirki-control-dimension-style', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.css'), [], self::$control_ver);
62 62
 
63 63
 		wp_localize_script(
64 64
 			'kirki-control-dimension',
65 65
 			'dimensionkirkiL10n',
66 66
 			[
67
-				'invalid-value' => esc_html__( 'Invalid Value', 'kirki' ),
67
+				'invalid-value' => esc_html__('Invalid Value', 'kirki'),
68 68
 			]
69 69
 		);
70 70
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @return string
82 82
 	 */
83 83
 	public static function get_control_path_url() {
84
-		return URL::get_from_path( dirname( __DIR__ ) );
84
+		return URL::get_from_path(dirname(__DIR__));
85 85
 	}
86 86
 
87 87
 	/**
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 
97 97
 		$input_class = 'kirki-control-input';
98 98
 
99
-		if ( isset( $this->input_attrs['class'] ) ) {
99
+		if (isset($this->input_attrs['class'])) {
100 100
 			$input_class .= ' ' . $this->input_attrs['class'];
101
-			unset( $this->input_attrs['class'] );
101
+			unset($this->input_attrs['class']);
102 102
 		}
103 103
 
104 104
 		// Get the basics from the parent class.
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		// Label position.
111 111
 		$this->json['labelPosition'] = 'top';
112 112
 
113
-		if ( isset( $this->choices['label_position'] ) && 'bottom' === $this->choices['label_position'] ) {
113
+		if (isset($this->choices['label_position']) && 'bottom' === $this->choices['label_position']) {
114 114
 			$this->json['labelPosition'] = 'bottom';
115 115
 		}
116 116
 
Please login to merge, or discard this patch.
kirki-4.0.24/packages/kirki-framework/module-sections/src/Section.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -54,21 +54,21 @@  discard block
 block discarded – undo
54 54
 	 * @param string $id   The section ID.
55 55
 	 * @param array  $args The section args.
56 56
 	 */
57
-	public function __construct( $id, $args = [] ) {
57
+	public function __construct($id, $args = []) {
58 58
 		$this->id   = $id;
59 59
 		$this->args = $args;
60 60
 
61
-		$this->section_types = apply_filters( 'kirki_section_types', $this->section_types );
61
+		$this->section_types = apply_filters('kirki_section_types', $this->section_types);
62 62
 
63
-		do_action( 'kirki_section_init', $id, $args );
63
+		do_action('kirki_section_init', $id, $args);
64 64
 
65
-		add_action( 'customize_register', [ $this, 'register_section_types' ] );
65
+		add_action('customize_register', [$this, 'register_section_types']);
66 66
 
67
-		if ( $this->args ) {
68
-			add_action( 'customize_register', [ $this, 'add_section' ] );
67
+		if ($this->args) {
68
+			add_action('customize_register', [$this, 'add_section']);
69 69
 		}
70
-		add_action( 'customize_controls_enqueue_scripts', [ $this, 'enqueue_scrips' ] );
71
-		add_action( 'customize_controls_print_footer_scripts', [ $this, 'outer_sections_css' ] );
70
+		add_action('customize_controls_enqueue_scripts', [$this, 'enqueue_scrips']);
71
+		add_action('customize_controls_print_footer_scripts', [$this, 'outer_sections_css']);
72 72
 	}
73 73
 
74 74
 	/**
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	 * @param object $wp_customize The customizer object.
80 80
 	 * @return void
81 81
 	 */
82
-	public function register_section_types( $wp_customize ) {
83
-		foreach ( $this->section_types as $section_type ) {
84
-			$wp_customize->register_section_type( $section_type );
82
+	public function register_section_types($wp_customize) {
83
+		foreach ($this->section_types as $section_type) {
84
+			$wp_customize->register_section_type($section_type);
85 85
 		}
86 86
 	}
87 87
 
@@ -92,28 +92,28 @@  discard block
 block discarded – undo
92 92
 	 * @since 1.0.0
93 93
 	 * @param object $wp_customize The customizer object.
94 94
 	 */
95
-	public function add_section( $wp_customize ) {
95
+	public function add_section($wp_customize) {
96 96
 
97 97
 		// Figure out the type of this section.
98
-		$this->args['type'] = isset( $this->args['type'] ) ? $this->args['type'] : 'default';
99
-		if ( isset( $this->args['section'] ) && ! empty( $this->args['section'] ) ) {
98
+		$this->args['type'] = isset($this->args['type']) ? $this->args['type'] : 'default';
99
+		if (isset($this->args['section']) && !empty($this->args['section'])) {
100 100
 			$this->args['type'] = 'kirki-nested';
101 101
 
102 102
 			// We need to check if the parent section is nested inside a panel.
103
-			$parent_section = $wp_customize->get_section( $this->args['section'] );
104
-			if ( $parent_section && isset( $parent_section->panel ) ) {
103
+			$parent_section = $wp_customize->get_section($this->args['section']);
104
+			if ($parent_section && isset($parent_section->panel)) {
105 105
 				$this->args['panel'] = $parent_section->panel;
106 106
 			}
107 107
 		}
108
-		$this->args['type'] = false === strpos( $this->args['type'], 'kirki-' ) ? 'kirki-' . $this->args['type'] : $this->args['type'];
108
+		$this->args['type'] = false === strpos($this->args['type'], 'kirki-') ? 'kirki-' . $this->args['type'] : $this->args['type'];
109 109
 
110 110
 		// Get the class we'll be using to create this section.
111 111
 		$section_classname = '\WP_Customize_Section';
112
-		if ( isset( $this->section_types[ $this->args['type'] ] ) ) {
113
-			$section_classname = $this->section_types[ $this->args['type'] ];
112
+		if (isset($this->section_types[$this->args['type']])) {
113
+			$section_classname = $this->section_types[$this->args['type']];
114 114
 		}
115 115
 
116
-		if ( isset( $this->args['type'] ) && 'kirki-outer' === $this->args['type'] ) {
116
+		if (isset($this->args['type']) && 'kirki-outer' === $this->args['type']) {
117 117
 			$this->args['type'] = 'outer';
118 118
 			$section_classname  = 'WP_Customize_Section'; // ? Bagus: we should be using `\` (backslash) right? Lookk at above.
119 119
 		}
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
 			new $section_classname(
124 124
 				$wp_customize,
125 125
 				$this->id,
126
-				apply_filters( 'kirki_section_args', $this->args, $this->id )
126
+				apply_filters('kirki_section_args', $this->args, $this->id)
127 127
 			)
128 128
 		);
129 129
 
130 130
 		// Run an action after the section has been added.
131
-		do_action( 'kirki_section_added', $this->id, $this->args );
131
+		do_action('kirki_section_added', $this->id, $this->args);
132 132
 	}
133 133
 
134 134
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @return void
140 140
 	 */
141 141
 	public function remove() {
142
-		add_action( 'customize_register', [ $this, 'remove_section' ], 9999 );
142
+		add_action('customize_register', [$this, 'remove_section'], 9999);
143 143
 	}
144 144
 
145 145
 	/**
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	 * @since 1.0.0
150 150
 	 * @param object $wp_customize The customizer object.
151 151
 	 */
152
-	public function remove_section( $wp_customize ) {
153
-		$wp_customize->remove_section( $this->id );
152
+	public function remove_section($wp_customize) {
153
+		$wp_customize->remove_section($this->id);
154 154
 	}
155 155
 
156 156
 	/**
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 	 * @since 1.0.0
161 161
 	 */
162 162
 	public function enqueue_scrips() {
163
-		wp_enqueue_style( 'kirki-sections', URL::get_from_path( __DIR__ . '/styles.css' ), [], '1.0' );
164
-		wp_enqueue_script( 'kirki-sections', URL::get_from_path( __DIR__ . '/script.js' ), [ 'jquery', 'customize-base', 'customize-controls' ], '1.0', false );
163
+		wp_enqueue_style('kirki-sections', URL::get_from_path(__DIR__ . '/styles.css'), [], '1.0');
164
+		wp_enqueue_script('kirki-sections', URL::get_from_path(__DIR__ . '/script.js'), ['jquery', 'customize-base', 'customize-controls'], '1.0', false);
165 165
 	}
166 166
 
167 167
 	/**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	 * @return void
174 174
 	 */
175 175
 	public function outer_sections_css() {
176
-		if ( isset( $this->args['type'] ) && ( 'outer' === $this->args['type'] || 'kirki-outer' === $this->args['type'] ) ) {
177
-			echo '<style>#customize-theme-controls li#accordion-section-' . esc_html( $this->id ) . ',li#sub-accordion-section-' . esc_html( $this->id ) . '{display:list-item!important;}</style>';
176
+		if (isset($this->args['type']) && ('outer' === $this->args['type'] || 'kirki-outer' === $this->args['type'])) {
177
+			echo '<style>#customize-theme-controls li#accordion-section-' . esc_html($this->id) . ',li#sub-accordion-section-' . esc_html($this->id) . '{display:list-item!important;}</style>';
178 178
 		}
179 179
 	}
180 180
 }
Please login to merge, or discard this patch.
packages/kirki-framework/module-sections/src/Section_Types/Nested.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,15 +54,15 @@
 block discarded – undo
54 54
 			]
55 55
 		);
56 56
 
57
-		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
57
+		$array['title']          = html_entity_decode($this->title, ENT_QUOTES, get_bloginfo('charset'));
58 58
 		$array['content']        = $this->get_content();
59 59
 		$array['active']         = $this->active();
60 60
 		$array['instanceNumber'] = $this->instance_number;
61 61
 
62
-		$array['customizeAction'] = esc_html__( 'Customizing', 'kirki' );
63
-		if ( $this->panel ) {
62
+		$array['customizeAction'] = esc_html__('Customizing', 'kirki');
63
+		if ($this->panel) {
64 64
 			/* translators: The title. */
65
-			$array['customizeAction'] = sprintf( esc_html__( 'Customizing &#9656; %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );
65
+			$array['customizeAction'] = sprintf(esc_html__('Customizing &#9656; %s', 'kirki'), esc_html($this->manager->get_panel($this->panel)->title));
66 66
 		}
67 67
 		return $array;
68 68
 	}
Please login to merge, or discard this patch.