Passed
Pull Request — master (#1930)
by Aristeides
04:03
created
modules/css/field/class-kirki-output-field-typography.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	protected function process_output( $output, $value ) {
25 25
 
26
-		$output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global';
27
-		$output['element']     = ( isset( $output['element'] ) ) ? $output['element'] : 'body';
28
-		$output['prefix']      = ( isset( $output['prefix'] ) ) ? $output['prefix'] : '';
29
-		$output['suffix']      = ( isset( $output['suffix'] ) ) ? $output['suffix'] : '';
26
+		$output[ 'media_query' ] = ( isset( $output[ 'media_query' ] ) ) ? $output[ 'media_query' ] : 'global';
27
+		$output[ 'element' ]     = ( isset( $output[ 'element' ] ) ) ? $output[ 'element' ] : 'body';
28
+		$output[ 'prefix' ]      = ( isset( $output[ 'prefix' ] ) ) ? $output[ 'prefix' ] : '';
29
+		$output[ 'suffix' ]      = ( isset( $output[ 'suffix' ] ) ) ? $output[ 'suffix' ] : '';
30 30
 
31 31
 		$value = Kirki_Field_Typography::sanitize( $value );
32 32
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		foreach ( $properties as $property ) {
49 49
 
50 50
 			// Early exit if the value is not in the defaults.
51
-			if ( ! isset( $this->field['default'][ $property ] ) ) {
51
+			if ( ! isset( $this->field[ 'default' ][ $property ] ) ) {
52 52
 				continue;
53 53
 			}
54 54
 
@@ -58,39 +58,39 @@  discard block
 block discarded – undo
58 58
 			}
59 59
 
60 60
 			// Early exit if we use "choice" but not for this property.
61
-			if ( isset( $output['choice'] ) && $output['choice'] !== $property ) {
61
+			if ( isset( $output[ 'choice' ] ) && $output[ 'choice' ] !== $property ) {
62 62
 				continue;
63 63
 			}
64 64
 
65 65
 			// Take care of variants.
66
-			if ( 'variant' === $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) {
66
+			if ( 'variant' === $property && isset( $value[ 'variant' ] ) && ! empty( $value[ 'variant' ] ) ) {
67 67
 
68 68
 				// Get the font_weight.
69
-				$font_weight = str_replace( 'italic', '', $value['variant'] );
69
+				$font_weight = str_replace( 'italic', '', $value[ 'variant' ] );
70 70
 				$font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight;
71 71
 
72 72
 				// Is this italic?
73
-				$is_italic = ( false !== strpos( $value['variant'], 'italic' ) );
74
-				$this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight;
73
+				$is_italic = ( false !== strpos( $value[ 'variant' ], 'italic' ) );
74
+				$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'font-weight' ] = $font_weight;
75 75
 				if ( $is_italic ) {
76
-					$this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic';
76
+					$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'font-style' ] = 'italic';
77 77
 				}
78 78
 				continue;
79 79
 			}
80 80
 
81 81
 			$property_value = $this->process_property_value( $property, $value[ $property ] );
82 82
 			if ( 'font-family' === $property ) {
83
-				$value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : '';
83
+				$value[ 'font-backup' ] = ( isset( $value[ 'font-backup' ] ) ) ? $value[ 'font-backup' ] : '';
84 84
 				$property_value       = $this->process_property_value(
85 85
 					$property, array(
86
-						$value['font-family'],
87
-						$value['font-backup'],
86
+						$value[ 'font-family' ],
87
+						$value[ 'font-backup' ],
88 88
 					)
89 89
 				);
90 90
 			}
91
-			$property       = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property;
92
-			$property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value;
93
-			$this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix'];
91
+			$property       = ( isset( $output[ 'choice' ] ) && isset( $output[ 'property' ] ) ) ? $output[ 'property' ] : $property;
92
+			$property_value = ( is_array( $property_value ) && isset( $property_value[ 0 ] ) ) ? $property_value[ 0 ] : $property_value;
93
+			$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $output[ 'prefix' ] . $property_value . $output[ 'suffix' ];
94 94
 		}
95 95
 	}
96 96
 }
Please login to merge, or discard this patch.
modules/css/field/class-kirki-output-field-image.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	protected function process_output( $output, $value ) {
25 25
 
26
-		if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
26
+		if ( ! isset( $output[ 'element' ] ) || ! isset( $output[ 'property' ] ) ) {
27 27
 			return;
28 28
 		}
29 29
 		$output = wp_parse_args(
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
 			)
36 36
 		);
37 37
 		if ( is_array( $value ) ) {
38
-			if ( isset( $output['choice'] ) && $output['choice'] ) {
39
-				$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value[ $output['choice'] ] ) . $output['units'] . $output['suffix'];
38
+			if ( isset( $output[ 'choice' ] ) && $output[ 'choice' ] ) {
39
+				$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value[ $output[ 'choice' ] ] ) . $output[ 'units' ] . $output[ 'suffix' ];
40 40
 				return;
41 41
 			}
42
-			if ( isset( $value['url'] ) ) {
43
-				$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix'];
42
+			if ( isset( $value[ 'url' ] ) ) {
43
+				$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value[ 'url' ] ) . $output[ 'units' ] . $output[ 'suffix' ];
44 44
 				return;
45 45
 			}
46 46
 			return;
47 47
 		}
48
-		$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix'];
48
+		$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value ) . $output[ 'units' ] . $output[ 'suffix' ];
49 49
 	}
50 50
 }
Please login to merge, or discard this patch.
modules/css/class-kirki-output.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	protected function apply_sanitize_callback( $output, $value ) {
85 85
 
86
-		if ( isset( $output['sanitize_callback'] ) && null !== $output['sanitize_callback'] ) {
86
+		if ( isset( $output[ 'sanitize_callback' ] ) && null !== $output[ 'sanitize_callback' ] ) {
87 87
 
88 88
 			// If the sanitize_callback is invalid, return the value.
89
-			if ( ! is_callable( $output['sanitize_callback'] ) ) {
89
+			if ( ! is_callable( $output[ 'sanitize_callback' ] ) ) {
90 90
 				return $value;
91 91
 			}
92
-			return call_user_func( $output['sanitize_callback'], $this->value );
92
+			return call_user_func( $output[ 'sanitize_callback' ], $this->value );
93 93
 		}
94 94
 
95 95
 		return $value;
@@ -105,22 +105,22 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	protected function apply_value_pattern( $output, $value ) {
107 107
 
108
-		if ( isset( $output['value_pattern'] ) && ! empty( $output['value_pattern'] ) && is_string( $output['value_pattern'] ) ) {
108
+		if ( isset( $output[ 'value_pattern' ] ) && ! empty( $output[ 'value_pattern' ] ) && is_string( $output[ 'value_pattern' ] ) ) {
109 109
 			if ( ! is_array( $value ) ) {
110
-				$value = str_replace( '$', $value, $output['value_pattern'] );
110
+				$value = str_replace( '$', $value, $output[ 'value_pattern' ] );
111 111
 			}
112 112
 			if ( is_array( $value ) ) {
113 113
 				foreach ( array_keys( $value ) as $value_k ) {
114 114
 					if ( ! is_string( $value[ $value_k ] ) ) {
115 115
 						continue;
116 116
 					}
117
-					if ( isset( $output['choice'] ) ) {
118
-						if ( $output['choice'] === $value_k ) {
119
-							$value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] );
117
+					if ( isset( $output[ 'choice' ] ) ) {
118
+						if ( $output[ 'choice' ] === $value_k ) {
119
+							$value[ $output[ 'choice' ] ] = str_replace( '$', $value[ $output[ 'choice' ] ], $output[ 'value_pattern' ] );
120 120
 						}
121 121
 						continue;
122 122
 					}
123
-					$value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] );
123
+					$value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output[ 'value_pattern' ] );
124 124
 				}
125 125
 			}
126 126
 			$value = $this->apply_pattern_replace( $output, $value );
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
 	 * @return string|array
137 137
 	 */
138 138
 	protected function apply_pattern_replace( $output, $value ) {
139
-		if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) {
139
+		if ( isset( $output[ 'pattern_replace' ] ) && is_array( $output[ 'pattern_replace' ] ) ) {
140 140
 			$option_type = ( '' !== Kirki::get_config_param( $this->config_id, 'option_type' ) ) ? Kirki::get_config_param( $this->config_id, 'option_type' ) : 'theme_mod';
141 141
 			$option_name = Kirki::get_config_param( $this->config_id, 'option_name' );
142 142
 			$options     = array();
143 143
 			if ( $option_name ) {
144 144
 				$options = ( 'site_option' === $option_type ) ? get_site_option( $option_name ) : get_option( $option_name );
145 145
 			}
146
-			foreach ( $output['pattern_replace'] as $search => $replace ) {
146
+			foreach ( $output[ 'pattern_replace' ] as $search => $replace ) {
147 147
 				$replacement = '';
148 148
 				switch ( $option_type ) {
149 149
 					case 'option':
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 			}
204 204
 
205 205
 			// No need to proceed this if the current value is the same as in the "exclude" value.
206
-			if ( isset( $output['exclude'] ) && is_array( $output['exclude'] ) ) {
207
-				foreach ( $output['exclude'] as $exclude ) {
206
+			if ( isset( $output[ 'exclude' ] ) && is_array( $output[ 'exclude' ] ) ) {
207
+				foreach ( $output[ 'exclude' ] as $exclude ) {
208 208
 					if ( is_array( $value ) ) {
209 209
 						if ( is_array( $exclude ) ) {
210 210
 							$diff1 = array_diff( $value, $exclude );
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 						}
217 217
 						// If 'choice' is defined check for sub-values too.
218 218
 						// Fixes https://github.com/aristath/kirki/issues/1416.
219
-						if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
219
+						if ( isset( $output[ 'choice' ] ) && isset( $value[ $output[ 'choice' ] ] ) && $exclude == $value[ $output[ 'choice' ] ] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
220 220
 							$skip = true;
221 221
 						}
222 222
 					}
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
 			// Apply any value patterns defined.
238 238
 			$value = $this->apply_value_pattern( $output, $value );
239 239
 
240
-			if ( isset( $output['element'] ) && is_array( $output['element'] ) ) {
241
-				$output['element'] = array_unique( $output['element'] );
242
-				sort( $output['element'] );
243
-				$output['element'] = implode( ',', $output['element'] );
240
+			if ( isset( $output[ 'element' ] ) && is_array( $output[ 'element' ] ) ) {
241
+				$output[ 'element' ] = array_unique( $output[ 'element' ] );
242
+				sort( $output[ 'element' ] );
243
+				$output[ 'element' ] = implode( ',', $output[ 'element' ] );
244 244
 			}
245 245
 
246 246
 			$value = $this->process_value( $value, $output );
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 	 * @return null
259 259
 	 */
260 260
 	protected function process_output( $output, $value ) {
261
-		if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
261
+		if ( ! isset( $output[ 'element' ] ) || ! isset( $output[ 'property' ] ) ) {
262 262
 			return;
263 263
 		}
264
-		$output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global';
265
-		$output['prefix']      = ( isset( $output['prefix'] ) ) ? $output['prefix'] : '';
266
-		$output['units']       = ( isset( $output['units'] ) ) ? $output['units'] : '';
267
-		$output['suffix']      = ( isset( $output['suffix'] ) ) ? $output['suffix'] : '';
264
+		$output[ 'media_query' ] = ( isset( $output[ 'media_query' ] ) ) ? $output[ 'media_query' ] : 'global';
265
+		$output[ 'prefix' ]      = ( isset( $output[ 'prefix' ] ) ) ? $output[ 'prefix' ] : '';
266
+		$output[ 'units' ]       = ( isset( $output[ 'units' ] ) ) ? $output[ 'units' ] : '';
267
+		$output[ 'suffix' ]      = ( isset( $output[ 'suffix' ] ) ) ? $output[ 'suffix' ] : '';
268 268
 
269 269
 		// Properties that can accept multiple values.
270 270
 		// Useful for example for gradients where all browsers use the "background-image" property
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
 			'background-image',
274 274
 			'background',
275 275
 		);
276
-		if ( in_array( $output['property'], $accepts_multiple, true ) ) {
277
-			if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) {
278
-				$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ];
276
+		if ( in_array( $output[ 'property' ], $accepts_multiple, true ) ) {
277
+			if ( isset( $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] ) && ! is_array( $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] ) ) {
278
+				$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = (array) $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ];
279 279
 			}
280
-			$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
280
+			$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ][ ] = $output[ 'prefix' ] . $value . $output[ 'units' ] . $output[ 'suffix' ];
281 281
 			return;
282 282
 		}
283 283
 		if ( is_string( $value ) || is_numeric( $value ) ) {
284
-			$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix'];
284
+			$this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value ) . $output[ 'units' ] . $output[ 'suffix' ];
285 285
 		}
286 286
 	}
287 287
 
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 	 * @return string|array
321 321
 	 */
322 322
 	protected function process_value( $value, $output ) {
323
-		if ( isset( $output['property'] ) ) {
324
-			return $this->process_property_value( $output['property'], $value );
323
+		if ( isset( $output[ 'property' ] ) ) {
324
+			return $this->process_property_value( $output[ 'property' ], $value );
325 325
 		}
326 326
 		return $value;
327 327
 	}
Please login to merge, or discard this patch.
modules/css/class-kirki-modules-css-generator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 	public static function css( $field ) {
147 147
 
148 148
 		// Set class vars.
149
-		self::$settings   = $field['settings'];
150
-		self::$callback   = $field['sanitize_callback'];
151
-		self::$field_type = $field['type'];
152
-		self::$output     = $field['output'];
149
+		self::$settings   = $field[ 'settings' ];
150
+		self::$callback   = $field[ 'sanitize_callback' ];
151
+		self::$field_type = $field[ 'type' ];
152
+		self::$output     = $field[ 'output' ];
153 153
 		if ( ! is_array( self::$output ) ) {
154 154
 			self::$output = array(
155 155
 				array(
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		// Find the class that will handle the outpout for this field.
166 166
 		$classname            = 'Kirki_Output';
167 167
 		$field_output_classes = apply_filters(
168
-			"kirki_{$field['kirki_config']}_output_control_classnames", array(
168
+			"kirki_{$field[ 'kirki_config' ]}_output_control_classnames", array(
169 169
 				'kirki-background' => 'Kirki_Output_Field_Background',
170 170
 				'kirki-dimensions' => 'Kirki_Output_Field_Dimensions',
171 171
 				'kirki-image'      => 'Kirki_Output_Field_Image',
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		if ( array_key_exists( self::$field_type, $field_output_classes ) ) {
177 177
 			$classname = $field_output_classes[ self::$field_type ];
178 178
 		}
179
-		$obj = new $classname( $field['kirki_config'], self::$output, self::$value, $field );
179
+		$obj = new $classname( $field[ 'kirki_config' ], self::$output, self::$value, $field );
180 180
 		return $obj->get_styles();
181 181
 
182 182
 	}
Please login to merge, or discard this patch.
modules/customizer-branding/class-kirki-modules-customizer-branding.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,14 +73,14 @@
 block discarded – undo
73 73
 			'logoImage'   => '',
74 74
 			'description' => '',
75 75
 		);
76
-		if ( isset( $config['logo_image'] ) && '' !== $config['logo_image'] ) {
77
-			$vars['logoImage'] = esc_url_raw( $config['logo_image'] );
76
+		if ( isset( $config[ 'logo_image' ] ) && '' !== $config[ 'logo_image' ] ) {
77
+			$vars[ 'logoImage' ] = esc_url_raw( $config[ 'logo_image' ] );
78 78
 		}
79
-		if ( isset( $config['description'] ) && '' !== $config['description'] ) {
80
-			$vars['description'] = esc_textarea( $config['description'] );
79
+		if ( isset( $config[ 'description' ] ) && '' !== $config[ 'description' ] ) {
80
+			$vars[ 'description' ] = esc_textarea( $config[ 'description' ] );
81 81
 		}
82 82
 
83
-		if ( ! empty( $vars['logoImage'] ) || ! empty( $vars['description'] ) ) {
83
+		if ( ! empty( $vars[ 'logoImage' ] ) || ! empty( $vars[ 'description' ] ) ) {
84 84
 			wp_register_script( 'kirki-branding', Kirki::$url . '/modules/customizer-branding/branding.js', array(), KIRKI_VERSION, false );
85 85
 			wp_localize_script( 'kirki-branding', 'kirkiBranding', $vars );
86 86
 			wp_enqueue_script( 'kirki-branding' );
Please login to merge, or discard this patch.
modules/custom-sections/panels/class-kirki-panels-nested-panel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
 			)
52 52
 		);
53 53
 
54
-		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
55
-		$array['content']        = $this->get_content();
56
-		$array['active']         = $this->active();
57
-		$array['instanceNumber'] = $this->instance_number;
54
+		$array[ 'title' ]          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
55
+		$array[ 'content' ]        = $this->get_content();
56
+		$array[ 'active' ]         = $this->active();
57
+		$array[ 'instanceNumber' ] = $this->instance_number;
58 58
 
59 59
 		return $array;
60 60
 	}
Please login to merge, or discard this patch.
modules/custom-sections/sections/class-kirki-sections-nested-section.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,15 +53,15 @@
 block discarded – undo
53 53
 			)
54 54
 		);
55 55
 
56
-		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
57
-		$array['content']        = $this->get_content();
58
-		$array['active']         = $this->active();
59
-		$array['instanceNumber'] = $this->instance_number;
56
+		$array[ 'title' ]          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
57
+		$array[ 'content' ]        = $this->get_content();
58
+		$array[ 'active' ]         = $this->active();
59
+		$array[ 'instanceNumber' ] = $this->instance_number;
60 60
 
61
-		$array['customizeAction'] = esc_attr__( 'Customizing', 'kirki' );
61
+		$array[ 'customizeAction' ] = esc_attr__( 'Customizing', 'kirki' );
62 62
 		if ( $this->panel ) {
63 63
 			/* translators: The title. */
64
-			$array['customizeAction'] = sprintf( esc_attr__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );
64
+			$array[ 'customizeAction' ] = sprintf( esc_attr__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );
65 65
 		}
66 66
 		return $array;
67 67
 	}
Please login to merge, or discard this patch.
core/class-kirki-values.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function typography_field_tweaks( $value, $field_id ) {
42 42
 
43
-		if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['type'] ) ) {
44
-			if ( 'kirki-typography' === Kirki::$fields[ $field_id ]['type'] ) {
43
+		if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ][ 'type' ] ) ) {
44
+			if ( 'kirki-typography' === Kirki::$fields[ $field_id ][ 'type' ] ) {
45 45
 
46 46
 				// Sanitize the value.
47 47
 				// This also adds font-weight if it doesn't already exist.
48 48
 				$value = Kirki_Field_Typography::sanitize( $value );
49 49
 
50 50
 				// Combine font-family and font-backup.
51
-				if ( isset( $value['font-family'] ) && isset( $value['font-backup'] ) ) {
52
-					$value['font-family'] .= ', ' . $value['font-backup'];
53
-					unset( $value['font-backup'] );
51
+				if ( isset( $value[ 'font-family' ] ) && isset( $value[ 'font-backup' ] ) ) {
52
+					$value[ 'font-family' ] .= ', ' . $value[ 'font-backup' ];
53
+					unset( $value[ 'font-backup' ] );
54 54
 				}
55 55
 			}
56 56
 		}
@@ -87,39 +87,39 @@  discard block
 block discarded – undo
87 87
 			$config_id = 'global';
88 88
 		}
89 89
 
90
-		if ( 'theme_mod' === Kirki::$config[ $config_id ]['option_type'] ) {
90
+		if ( 'theme_mod' === Kirki::$config[ $config_id ][ 'option_type' ] ) {
91 91
 
92 92
 			// We're using theme_mods so just get the value using get_theme_mod.
93 93
 			$default_value = null;
94
-			if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['default'] ) ) {
95
-				$default_value = Kirki::$fields[ $field_id ]['default'];
94
+			if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ][ 'default' ] ) ) {
95
+				$default_value = Kirki::$fields[ $field_id ][ 'default' ];
96 96
 			}
97 97
 			$value = get_theme_mod( $field_id, $default_value );
98 98
 			return apply_filters( 'kirki_values_get_value', $value, $field_id );
99 99
 		}
100 100
 
101
-		if ( 'option' === Kirki::$config[ $config_id ]['option_type'] ) {
101
+		if ( 'option' === Kirki::$config[ $config_id ][ 'option_type' ] ) {
102 102
 
103 103
 			// We're using options.
104
-			if ( '' !== Kirki::$config[ $config_id ]['option_name'] ) {
104
+			if ( '' !== Kirki::$config[ $config_id ][ 'option_name' ] ) {
105 105
 
106 106
 				// Options are serialized as a single option in the db.
107 107
 				// We'll have to get the option and then get the item from the array.
108
-				$options = get_option( Kirki::$config[ $config_id ]['option_name'] );
108
+				$options = get_option( Kirki::$config[ $config_id ][ 'option_name' ] );
109 109
 
110
-				if ( ! isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ Kirki::$config[ $config_id ]['option_name'] . '[' . $field_id . ']' ] ) ) {
111
-					$field_id = Kirki::$config[ $config_id ]['option_name'] . '[' . $field_id . ']';
110
+				if ( ! isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ Kirki::$config[ $config_id ][ 'option_name' ] . '[' . $field_id . ']' ] ) ) {
111
+					$field_id = Kirki::$config[ $config_id ][ 'option_name' ] . '[' . $field_id . ']';
112 112
 				}
113
-				$setting_modified = str_replace( ']', '', str_replace( Kirki::$config[ $config_id ]['option_name'] . '[', '', $field_id ) );
113
+				$setting_modified = str_replace( ']', '', str_replace( Kirki::$config[ $config_id ][ 'option_name' ] . '[', '', $field_id ) );
114 114
 
115
-				$default_value = ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['default'] ) ) ? Kirki::$fields[ $field_id ]['default'] : '';
115
+				$default_value = ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ][ 'default' ] ) ) ? Kirki::$fields[ $field_id ][ 'default' ] : '';
116 116
 				$value         = ( isset( $options[ $setting_modified ] ) ) ? $options[ $setting_modified ] : $default_value;
117 117
 				$value         = maybe_unserialize( $value );
118 118
 				return apply_filters( 'kirki_values_get_value', $value, $field_id );
119 119
 			}
120 120
 
121 121
 			// Each option separately saved in the db.
122
-			$value = get_option( $field_id, Kirki::$fields[ $field_id ]['default'] );
122
+			$value = get_option( $field_id, Kirki::$fields[ $field_id ][ 'default' ] );
123 123
 			return apply_filters( 'kirki_values_get_value', $value, $field_id );
124 124
 
125 125
 		}
@@ -135,18 +135,18 @@  discard block
 block discarded – undo
135 135
 	 * @return string|array
136 136
 	 */
137 137
 	public static function get_sanitized_field_value( $field ) {
138
-		$value = $field['default'];
139
-		if ( isset( $field['option_type'] ) && 'theme_mod' === $field['option_type'] ) {
140
-			$value = get_theme_mod( $field['settings'], $field['default'] );
141
-		} elseif ( isset( $field['option_type'] ) && 'option' === $field['option_type'] ) {
142
-			if ( isset( $field['option_name'] ) && '' !== $field['option_name'] ) {
143
-				$all_values     = get_option( $field['option_name'], array() );
144
-				$sub_setting_id = str_replace( array( ']', $field['option_name'] . '[' ), '', $field['settings'] );
138
+		$value = $field[ 'default' ];
139
+		if ( isset( $field[ 'option_type' ] ) && 'theme_mod' === $field[ 'option_type' ] ) {
140
+			$value = get_theme_mod( $field[ 'settings' ], $field[ 'default' ] );
141
+		} elseif ( isset( $field[ 'option_type' ] ) && 'option' === $field[ 'option_type' ] ) {
142
+			if ( isset( $field[ 'option_name' ] ) && '' !== $field[ 'option_name' ] ) {
143
+				$all_values     = get_option( $field[ 'option_name' ], array() );
144
+				$sub_setting_id = str_replace( array( ']', $field[ 'option_name' ] . '[' ), '', $field[ 'settings' ] );
145 145
 				if ( isset( $all_values[ $sub_setting_id ] ) ) {
146 146
 					$value = $all_values[ $sub_setting_id ];
147 147
 				}
148 148
 			} else {
149
-				$value = get_option( $field['settings'], $field['default'] );
149
+				$value = get_option( $field[ 'settings' ], $field[ 'default' ] );
150 150
 			}
151 151
 		}
152 152
 
Please login to merge, or discard this patch.
core/class-kirki-l10n.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
 
119 119
 		global $l10n;
120 120
 		if ( isset( $l10n[ $this->get_theme_textdomain() ] ) ) {
121
-			$l10n['kirki'] = $l10n[ $this->get_theme_textdomain() ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
121
+			$l10n[ 'kirki' ] = $l10n[ $this->get_theme_textdomain() ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
122 122
 		}
123 123
 
124 124
 		// Check if the domain is "kirki".
Please login to merge, or discard this patch.