Completed
Push — develop ( ab8ff0...63bff5 )
by Aristeides
02:34
created
core/class-kirki-field.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -335,13 +335,13 @@  discard block
 block discarded – undo
335 335
 
336 336
 		// Get the config arguments, and merge them with the defaults.
337 337
 		$config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array();
338
-		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) {
339
-			$config_defaults = Kirki::$config[ $this->kirki_config ];
338
+		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) {
339
+			$config_defaults = Kirki::$config[$this->kirki_config];
340 340
 		}
341 341
 		$config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array();
342 342
 		foreach ( $config_defaults as $key => $value ) {
343
-			if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value != $defaults[ $key ] ) {
344
-				$defaults[ $key ] = $value;
343
+			if ( isset( $defaults[$key] ) && ! empty( $value ) && $value != $defaults[$key] ) {
344
+				$defaults[$key] = $value;
345 345
 			}
346 346
 		}
347 347
 
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 		// Remove any whitelisted properties from above.
379 379
 		// These will get a free pass, completely unfiltered.
380 380
 		foreach ( $whitelisted_properties as $key => $default_value ) {
381
-			if ( isset( $properties[ $key ] ) ) {
382
-				unset( $properties[ $key ] );
381
+			if ( isset( $properties[$key] ) ) {
382
+				unset( $properties[$key] );
383 383
 			}
384 384
 		}
385 385
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 		// Get all arguments with their values.
412 412
 		$args = get_object_vars( $this );
413 413
 		foreach ( $args as $key => $default_value ) {
414
-			$args[ $key ] = $this->$key;
414
+			$args[$key] = $this->$key;
415 415
 		}
416 416
 
417 417
 		// Add the whitelisted properties through the back door.
@@ -419,11 +419,11 @@  discard block
 block discarded – undo
419 419
 			if ( ! isset( $this->$key ) ) {
420 420
 				$this->$key = $default_value;
421 421
 			}
422
-			$args[ $key ] = $this->$key;
422
+			$args[$key] = $this->$key;
423 423
 		}
424 424
 
425 425
 		// Add the field to the static $fields variable properly indexed.
426
-		Kirki::$fields[ $this->settings ] = $args;
426
+		Kirki::$fields[$this->settings] = $args;
427 427
 
428 428
 	}
429 429
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
531 531
 				/* translators: %1$s represents the field ID where the error occurs. */
532 532
 				_doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
533
-				unset( $this->partial_refresh[ $id ] );
533
+				unset( $this->partial_refresh[$id] );
534 534
 				continue;
535 535
 			}
536 536
 		}
@@ -558,10 +558,10 @@  discard block
 block discarded – undo
558 558
 		}
559 559
 		$settings = array();
560 560
 		foreach ( $this->settings as $setting_key => $setting_value ) {
561
-			$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
561
+			$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
562 562
 			// If we're using serialized options then we need to spice this up.
563 563
 			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
564
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
564
+				$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
565 565
 			}
566 566
 		}
567 567
 		$this->settings = $settings;
Please login to merge, or discard this patch.