Completed
Push — develop ( 217322...93a695 )
by Aristeides
03:02
created
core/class-kirki-field.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -327,13 +327,13 @@  discard block
 block discarded – undo
327 327
 
328 328
 		// Get the config arguments, and merge them with the defaults.
329 329
 		$config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array();
330
-		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) {
331
-			$config_defaults = Kirki::$config[ $this->kirki_config ];
330
+		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) {
331
+			$config_defaults = Kirki::$config[$this->kirki_config];
332 332
 		}
333 333
 		$config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array();
334 334
 		foreach ( $config_defaults as $key => $value ) {
335
-			if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value != $defaults[ $key ] ) {
336
-				$defaults[ $key ] = $value;
335
+			if ( isset( $defaults[$key] ) && ! empty( $value ) && $value != $defaults[$key] ) {
336
+				$defaults[$key] = $value;
337 337
 			}
338 338
 		}
339 339
 
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
 		// Remove any whitelisted properties from above.
371 371
 		// These will get a free pass, completely unfiltered.
372 372
 		foreach ( $whitelisted_properties as $key => $default_value ) {
373
-			if ( isset( $properties[ $key ] ) ) {
374
-				unset( $properties[ $key ] );
373
+			if ( isset( $properties[$key] ) ) {
374
+				unset( $properties[$key] );
375 375
 			}
376 376
 		}
377 377
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		// Get all arguments with their values.
404 404
 		$args = get_object_vars( $this );
405 405
 		foreach ( $args as $key => $default_value ) {
406
-			$args[ $key ] = $this->$key;
406
+			$args[$key] = $this->$key;
407 407
 		}
408 408
 
409 409
 		// Add the whitelisted properties through the back door.
@@ -411,11 +411,11 @@  discard block
 block discarded – undo
411 411
 			if ( ! isset( $this->$key ) ) {
412 412
 				$this->$key = $default_value;
413 413
 			}
414
-			$args[ $key ] = $this->$key;
414
+			$args[$key] = $this->$key;
415 415
 		}
416 416
 
417 417
 		// Add the field to the static $fields variable properly indexed.
418
-		Kirki::$fields[ $this->settings ] = $args;
418
+		Kirki::$fields[$this->settings] = $args;
419 419
 
420 420
 	}
421 421
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 		}
519 519
 		foreach ( $this->partial_refresh as $id => $args ) {
520 520
 			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
521
-				unset( $this->partial_refresh[ $id ] );
521
+				unset( $this->partial_refresh[$id] );
522 522
 				continue;
523 523
 			}
524 524
 		}
@@ -546,10 +546,10 @@  discard block
 block discarded – undo
546 546
 		}
547 547
 		$settings = array();
548 548
 		foreach ( $this->settings as $setting_key => $setting_value ) {
549
-			$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
549
+			$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
550 550
 			// If we're using serialized options then we need to spice this up.
551 551
 			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
552
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
552
+				$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
553 553
 			}
554 554
 		}
555 555
 		$this->settings = $settings;
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 		);
647 647
 
648 648
 		if ( array_key_exists( $this->type, $default_callbacks ) ) {
649
-			$this->sanitize_callback = $default_callbacks[ $this->type ];
649
+			$this->sanitize_callback = $default_callbacks[$this->type];
650 650
 		}
651 651
 
652 652
 	}
Please login to merge, or discard this patch.