Completed
Push — develop ( 7fd7c7...b66118 )
by Aristeides
03:45
created
core/class-kirki-field.php 1 patch
Spacing   +11 added lines, -11 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
 
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
 		// Get all arguments with their values.
390 390
 		$args = get_object_vars( $this );
391 391
 		foreach ( $args as $key => $default_value ) {
392
-			$args[ $key ] = $this->$key;
392
+			$args[$key] = $this->$key;
393 393
 		}
394 394
 
395 395
 		// Add the field to the static $fields variable properly indexed.
396
-		Kirki::$fields[ $this->settings ] = $args;
396
+		Kirki::$fields[$this->settings] = $args;
397 397
 
398 398
 	}
399 399
 
@@ -413,8 +413,8 @@  discard block
 block discarded – undo
413 413
 		if ( false !== strpos( $property, '_' ) ) {
414 414
 			$property_parts = explode( '_' );
415 415
 		}
416
-		foreach( $property_parts as $property_part_k => $property_part_v ) {
417
-			$property_parts[ $property_part_k ] = ucfirst( $property_part_v );
416
+		foreach ( $property_parts as $property_part_k => $property_part_v ) {
417
+			$property_parts[$property_part_k] = ucfirst( $property_part_v );
418 418
 		}
419 419
 		return 'Kirki_Field_Property_' . implode( '_', $property_parts );
420 420
 	}
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
560 560
 				/* translators: %1$s represents the field ID where the error occurs. */
561 561
 				_doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
562
-				unset( $this->partial_refresh[ $id ] );
562
+				unset( $this->partial_refresh[$id] );
563 563
 				continue;
564 564
 			}
565 565
 		}
@@ -587,10 +587,10 @@  discard block
 block discarded – undo
587 587
 		}
588 588
 		$settings = array();
589 589
 		foreach ( $this->settings as $setting_key => $setting_value ) {
590
-			$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
590
+			$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
591 591
 			// If we're using serialized options then we need to spice this up.
592 592
 			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
593
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
593
+				$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
594 594
 			}
595 595
 		}
596 596
 		$this->settings = $settings;
Please login to merge, or discard this patch.