Completed
Push — develop ( 4db9d5...98df20 )
by Aristeides
02:34
created
core/class-kirki-field.php 1 patch
Spacing   +9 added lines, -9 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
 
@@ -392,11 +392,11 @@  discard block
 block discarded – undo
392 392
 		// Get all arguments with their values.
393 393
 		$args = get_object_vars( $this );
394 394
 		foreach ( $args as $key => $default_value ) {
395
-			$args[ $key ] = $this->$key;
395
+			$args[$key] = $this->$key;
396 396
 		}
397 397
 
398 398
 		// Add the field to the static $fields variable properly indexed.
399
-		Kirki::$fields[ $this->settings ] = $args;
399
+		Kirki::$fields[$this->settings] = $args;
400 400
 
401 401
 	}
402 402
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
541 541
 				/* translators: %1$s represents the field ID where the error occurs. */
542 542
 				_doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
543
-				unset( $this->partial_refresh[ $id ] );
543
+				unset( $this->partial_refresh[$id] );
544 544
 				continue;
545 545
 			}
546 546
 		}
@@ -568,10 +568,10 @@  discard block
 block discarded – undo
568 568
 		}
569 569
 		$settings = array();
570 570
 		foreach ( $this->settings as $setting_key => $setting_value ) {
571
-			$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
571
+			$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
572 572
 			// If we're using serialized options then we need to spice this up.
573 573
 			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
574
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
574
+				$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
575 575
 			}
576 576
 		}
577 577
 		$this->settings = $settings;
Please login to merge, or discard this patch.