Completed
Push — develop ( 5f2b0c...a03475 )
by Aristeides
02:53 queued 02:48
created
core/class-kirki-field.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -322,14 +322,14 @@  discard block
 block discarded – undo
322 322
 
323 323
 		// Get the config arguments, and merge them with the defaults.
324 324
 		$config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array();
325
-		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) {
326
-			$config_defaults = Kirki::$config[ $this->kirki_config ];
325
+		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) {
326
+			$config_defaults = Kirki::$config[$this->kirki_config];
327 327
 		}
328 328
 		$config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array();
329 329
 		foreach ( $config_defaults as $key => $value ) {
330
-			if ( isset( $defaults[ $key ] ) ) {
331
-				if ( ! empty( $value ) && $value != $defaults[ $key ] ) {
332
-					$defaults[ $key ] = $value;
330
+			if ( isset( $defaults[$key] ) ) {
331
+				if ( ! empty( $value ) && $value != $defaults[$key] ) {
332
+					$defaults[$key] = $value;
333 333
 				}
334 334
 			}
335 335
 		}
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 		// Remove any whitelisted properties from above.
368 368
 		// These will get a free pass, completely unfiltered.
369 369
 		foreach ( $whitelisted_properties as $key => $default_value ) {
370
-			if ( isset( $properties[ $key ] ) ) {
371
-				unset( $properties[ $key ] );
370
+			if ( isset( $properties[$key] ) ) {
371
+				unset( $properties[$key] );
372 372
 			}
373 373
 		}
374 374
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		// Get all arguments with their values.
401 401
 		$args = get_class_vars( __CLASS__ );
402 402
 		foreach ( $args as $key => $default_value ) {
403
-			$args[ $key ] = $this->$key;
403
+			$args[$key] = $this->$key;
404 404
 		}
405 405
 
406 406
 		// Add the whitelisted properties through the back door.
@@ -408,11 +408,11 @@  discard block
 block discarded – undo
408 408
 			if ( ! isset( $this->$key ) ) {
409 409
 				$this->$key = $default_value;
410 410
 			}
411
-			$args[ $key ] = $this->$key;
411
+			$args[$key] = $this->$key;
412 412
 		}
413 413
 
414 414
 		// Add the field to the static $fields variable properly indexed.
415
-		Kirki::$fields[ $this->settings ] = $args;
415
+		Kirki::$fields[$this->settings] = $args;
416 416
 
417 417
 	}
418 418
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 		}
514 514
 		foreach ( $this->partial_refresh as $id => $args ) {
515 515
 			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
516
-				unset( $this->partial_refresh[ $id ] );
516
+				unset( $this->partial_refresh[$id] );
517 517
 				continue;
518 518
 			}
519 519
 		}
@@ -541,10 +541,10 @@  discard block
 block discarded – undo
541 541
 		}
542 542
 		$settings = array();
543 543
 		foreach ( $this->settings as $setting_key => $setting_value ) {
544
-			$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
544
+			$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
545 545
 			// If we're using serialized options then we need to spice this up.
546 546
 			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
547
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
547
+				$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
548 548
 			}
549 549
 		}
550 550
 		$this->settings = $settings;
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 		);
644 644
 
645 645
 		if ( array_key_exists( $this->type, $default_callbacks ) ) {
646
-			$this->sanitize_callback = $default_callbacks[ $this->type ];
646
+			$this->sanitize_callback = $default_callbacks[$this->type];
647 647
 		}
648 648
 
649 649
 	}
Please login to merge, or discard this patch.