Completed
Push — develop ( 3c302f...619ed9 )
by Aristeides
02:19 queued 10s
created
docs/files/class-my-theme-kirki.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -73,23 +73,23 @@  discard block
 block discarded – undo
73 73
 		// Kirki does not exist, continue with our custom implementation.
74 74
 		// Get the default value of the field.
75 75
 		$default = '';
76
-		if ( isset( self::$fields[ $field_id ] ) && isset( self::$fields[ $field_id ]['default'] ) ) {
77
-			$default = self::$fields[ $field_id ]['default'];
76
+		if ( isset( self::$fields[$field_id] ) && isset( self::$fields[$field_id]['default'] ) ) {
77
+			$default = self::$fields[$field_id]['default'];
78 78
 		}
79 79
 
80 80
 		// Make sure the config is defined.
81
-		if ( isset( self::$config[ $config_id ] ) ) {
82
-			if ( 'option' == self::$config[ $config_id ]['option_type'] ) {
81
+		if ( isset( self::$config[$config_id] ) ) {
82
+			if ( 'option' == self::$config[$config_id]['option_type'] ) {
83 83
 
84 84
 				// check if we're using serialized options.
85
-				if ( isset( self::$config[ $config_id ]['option_name'] ) && ! empty( self::$config[ $config_id ]['option_name'] ) ) {
85
+				if ( isset( self::$config[$config_id]['option_name'] ) && ! empty( self::$config[$config_id]['option_name'] ) ) {
86 86
 
87 87
 					// Get all our options.
88
-					$all_options = get_option( self::$config[ $config_id ]['option_name'], array() );
88
+					$all_options = get_option( self::$config[$config_id]['option_name'], array() );
89 89
 
90 90
 					// If our option is not saved, return the default value.
91 91
 					// If option was set, return its value unserialized.
92
-					return ( ! isset( $all_options[ $field_id ] ) ) ? $default : maybe_unserialize( $all_options[ $field_id ] );
92
+					return ( ! isset( $all_options[$field_id] ) ) ? $default : maybe_unserialize( $all_options[$field_id] );
93 93
 				}
94 94
 
95 95
 				// If we're not using serialized options, get the value and return it.
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
 		}
149 149
 
150 150
 		// Kirki does not exist, set the config arguments.
151
-		$config[ $config_id ] = $args;
151
+		$config[$config_id] = $args;
152 152
 
153 153
 		// Make sure an option_type is defined.
154
-		if ( ! isset( self::$config[ $config_id ]['option_type'] ) ) {
155
-			self::$config[ $config_id ]['option_type'] = 'theme_mod';
154
+		if ( ! isset( self::$config[$config_id]['option_type'] ) ) {
155
+			self::$config[$config_id]['option_type'] = 'theme_mod';
156 156
 		}
157 157
 	}
158 158
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			if ( ! isset( $args['kirki_config'] ) ) {
181 181
 				$args['kirki_config'] = $config_id;
182 182
 			}
183
-			self::$fields[ $args['settings'] ] = $args;
183
+			self::$fields[$args['settings']] = $args;
184 184
 		}
185 185
 	}
186 186
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 				if ( ! is_array( $value ) ) {
265 265
 					$value = str_replace( '$', $value, $output['value_pattern'] );
266 266
 					if ( ! empty( $output['element'] ) && ! empty( $output['property'] ) ) {
267
-						$css[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
267
+						$css[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
268 268
 					}
269 269
 				} else {
270 270
 					if ( 'typography' === $field['type'] ) {
@@ -278,27 +278,27 @@  discard block
 block discarded – undo
278 278
 
279 279
 							// Add double quotes if needed to font-families.
280 280
 							if ( 'font-family' == $key && false !== strpos( $subvalue, ' ' ) && false === strpos( $subvalue, '"' ) ) {
281
-								$css[ $output['media_query'] ][ $output['element'] ]['font-family'] = '"' . $subvalue . '"';
281
+								$css[$output['media_query']][$output['element']]['font-family'] = '"' . $subvalue . '"';
282 282
 							}
283 283
 
284 284
 							// Variants contain both font-weight & italics.
285 285
 							if ( 'variant' === $key ) {
286 286
 								$font_weight = str_replace( 'italic', '', $subvalue );
287 287
 								$font_weight = ( in_array( $font_weight, array( '', 'regular' ) ) ) ? '400' : $font_weight;
288
-								$css[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight;
288
+								$css[$output['media_query']][$output['element']]['font-weight'] = $font_weight;
289 289
 
290 290
 								// Is this italic?
291 291
 								if ( false !== strpos( $subvalue, 'italic' ) ) {
292
-									$css[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic';
292
+									$css[$output['media_query']][$output['element']]['font-style'] = 'italic';
293 293
 								}
294 294
 							} else {
295
-								$css[ $output['media_query'] ][ $output['element'] ][ $key ] = $subvalue;
295
+								$css[$output['media_query']][$output['element']][$key] = $subvalue;
296 296
 							}
297 297
 						}
298 298
 					} elseif ( 'multicolor' == $field['type'] ) {
299 299
 
300 300
 						if ( ! empty( $output['element'] ) && ! empty( $output['property'] ) && ! empty( $output['choice'] ) ) {
301
-							$css[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value[ $output['choice'] ] . $output['units'] . $output['suffix'];
301
+							$css[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value[$output['choice']] . $output['units'] . $output['suffix'];
302 302
 						}
303 303
 					} else {
304 304
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 								$subvalue = 'url("' . $subvalue . '")';
314 314
 							}
315 315
 							if ( $subvalue ) {
316
-								$css[ $output['media_query'] ][ $output['element'] ][ $property ] = $subvalue;
316
+								$css[$output['media_query']][$output['element']][$property] = $subvalue;
317 317
 							}
318 318
 						}
319 319
 					}
Please login to merge, or discard this patch.