Completed
Branch develop (540b6d)
by Aristeides
02:27
created
core/class-kirki-field.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -330,14 +330,14 @@  discard block
 block discarded – undo
330 330
 
331 331
 		// Get the config arguments, and merge them with the defaults.
332 332
 		$config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array();
333
-		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) {
334
-			$config_defaults = Kirki::$config[ $this->kirki_config ];
333
+		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) {
334
+			$config_defaults = Kirki::$config[$this->kirki_config];
335 335
 		}
336 336
 		$config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array();
337 337
 		foreach ( $config_defaults as $key => $value ) {
338
-			if ( isset( $defaults[ $key ] ) ) {
339
-				if ( ! empty( $value ) && $value != $defaults[ $key ] ) {
340
-					$defaults[ $key ] = $value;
338
+			if ( isset( $defaults[$key] ) ) {
339
+				if ( ! empty( $value ) && $value != $defaults[$key] ) {
340
+					$defaults[$key] = $value;
341 341
 				}
342 342
 			}
343 343
 		}
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
 		// Remove any whitelisted properties from above.
376 376
 		// These will get a free pass, completely unfiltered.
377 377
 		foreach ( $whitelisted_properties as $key => $default_value ) {
378
-			if ( isset( $properties[ $key ] ) ) {
379
-				unset( $properties[ $key ] );
378
+			if ( isset( $properties[$key] ) ) {
379
+				unset( $properties[$key] );
380 380
 			}
381 381
 		}
382 382
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 		// Get all arguments with their values.
409 409
 		$args = get_class_vars( __CLASS__ );
410 410
 		foreach ( $args as $key => $default_value ) {
411
-			$args[ $key ] = $this->$key;
411
+			$args[$key] = $this->$key;
412 412
 		}
413 413
 
414 414
 		// Add the whitelisted properties through the back door.
@@ -416,11 +416,11 @@  discard block
 block discarded – undo
416 416
 			if ( ! isset( $this->$key ) ) {
417 417
 				$this->$key = $default_value;
418 418
 			}
419
-			$args[ $key ] = $this->$key;
419
+			$args[$key] = $this->$key;
420 420
 		}
421 421
 
422 422
 		// Add the field to the static $fields variable properly indexed.
423
-		Kirki::$fields[ $this->settings ] = $args;
423
+		Kirki::$fields[$this->settings] = $args;
424 424
 
425 425
 		if ( 'background' === $this->type ) {
426 426
 			// Build the background fields.
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 		}
527 527
 		foreach ( $this->partial_refresh as $id => $args ) {
528 528
 			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
529
-				unset( $this->partial_refresh[ $id ] );
529
+				unset( $this->partial_refresh[$id] );
530 530
 				continue;
531 531
 			}
532 532
 		}
@@ -552,10 +552,10 @@  discard block
 block discarded – undo
552 552
 		}
553 553
 		$settings = array();
554 554
 		foreach ( $this->settings as $setting_key => $setting_value ) {
555
-			$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
555
+			$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
556 556
 			// If we're using serialized options then we need to spice this up.
557 557
 			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
558
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
558
+				$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
559 559
 			}
560 560
 		}
561 561
 		$this->settings = $settings;
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		);
656 656
 
657 657
 		if ( array_key_exists( $this->type, $default_callbacks ) ) {
658
-			$this->sanitize_callback = $default_callbacks[ $this->type ];
658
+			$this->sanitize_callback = $default_callbacks[$this->type];
659 659
 		}
660 660
 
661 661
 	}
Please login to merge, or discard this patch.
core/class-kirki.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @access public
51 51
 	 * @var array
52 52
 	 */
53
-	public static $config   = array();
53
+	public static $config = array();
54 54
 
55 55
 	/**
56 56
 	 * An array containing all fields.
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * @access public
60 60
 	 * @var array
61 61
 	 */
62
-	public static $fields   = array();
62
+	public static $fields = array();
63 63
 
64 64
 	/**
65 65
 	 * An array containing all panels.
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @access public
69 69
 	 * @var array
70 70
 	 */
71
-	public static $panels   = array();
71
+	public static $panels = array();
72 72
 
73 73
 	/**
74 74
 	 * An array containing all sections.
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 		$config = Kirki_Config::get_instance( $config_id, $args );
117 117
 		$config_args = $config->get_config();
118
-		self::$config[ $config_args['id'] ] = $config_args;
118
+		self::$config[$config_args['id']] = $config_args;
119 119
 
120 120
 	}
121 121
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 			$args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true';
139 139
 		}
140 140
 
141
-		self::$panels[ $args['id'] ] = $args;
141
+		self::$panels[$args['id']] = $args;
142 142
 
143 143
 	}
144 144
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			$args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true';
163 163
 		}
164 164
 
165
-		self::$sections[ $args['id'] ] = $args;
165
+		self::$sections[$args['id']] = $args;
166 166
 
167 167
 	}
168 168
 
Please login to merge, or discard this patch.
core/class-kirki-panel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 		if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) {
51 51
 			$args['type'] = 'kirki-default';
52 52
 		}
53
-		$panel_classname = $this->panel_types[ $args['type'] ];
53
+		$panel_classname = $this->panel_types[$args['type']];
54 54
 
55 55
 		// If we've got an icon then call the object to create its script.
56 56
 		if ( isset( $args['icon'] ) ) {
Please login to merge, or discard this patch.
core/class-kirki-init.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -203,9 +203,9 @@
 block discarded – undo
203 203
 						// and run it through the callback function.
204 204
 						// If no callback is defined (false) then just get the value.
205 205
 						if ( $variable_callback ) {
206
-							$variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) );
206
+							$variables[$variable_name] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) );
207 207
 						} else {
208
-							$variables[ $variable_name ] = Kirki::get_option( $field['settings'] );
208
+							$variables[$variable_name] = Kirki::get_option( $field['settings'] );
209 209
 						}
210 210
 					}
211 211
 				}
Please login to merge, or discard this patch.
core/class-kirki-helper.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 		}
43 43
 		$count = count( $args );
44 44
 		for ( $i = 1; $i < $count; $i++ ) {
45
-			if ( is_array( $args[ $i ] ) ) {
46
-				$array = self::recurse( $array, $args[ $i ] );
45
+			if ( is_array( $args[$i] ) ) {
46
+				$array = self::recurse( $array, $args[$i] );
47 47
 			}
48 48
 		}
49 49
 		return $array;
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
 	public static function recurse( $array, $array1 ) {
62 62
 		foreach ( $array1 as $key => $value ) {
63 63
 			// Create new key in $array, if it is empty or not an array.
64
-			if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) {
65
-				$array[ $key ] = array();
64
+			if ( ! isset( $array[$key] ) || ( isset( $array[$key] ) && ! is_array( $array[$key] ) ) ) {
65
+				$array[$key] = array();
66 66
 			}
67 67
 
68 68
 			// Overwrite the value in the base array.
69 69
 			if ( is_array( $value ) ) {
70
-				$value = self::recurse( $array[ $key ], $value );
70
+				$value = self::recurse( $array[$key], $value );
71 71
 			}
72
-			$array[ $key ] = $value;
72
+			$array[$key] = $value;
73 73
 		}
74 74
 		return $array;
75 75
 	}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		// Properly format the array.
135 135
 		$items = array();
136 136
 		foreach ( $posts as $post ) {
137
-			$items[ $post->ID ] = $post->post_title;
137
+			$items[$post->ID] = $post->post_title;
138 138
 		}
139 139
 
140 140
 		return $items;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		foreach ( $taxonomies as $taxonomy ) {
160 160
 			$id           = $taxonomy;
161 161
 			$taxonomy     = get_taxonomy( $taxonomy );
162
-			$items[ $id ] = $taxonomy->labels->name;
162
+			$items[$id] = $taxonomy->labels->name;
163 163
 		}
164 164
 
165 165
 		return $items;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 		// Build the array.
184 184
 		foreach ( $post_types as $post_type ) {
185
-			$items[ $post_type->name ] = $post_type->labels->name;
185
+			$items[$post_type->name] = $post_type->labels->name;
186 186
 		}
187 187
 
188 188
 		return $items;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
 		// Build the array.
208 208
 		foreach ( $terms as $term ) {
209
-			$items[ $term->term_id ] = $term->name;
209
+			$items[$term->term_id] = $term->name;
210 210
 		}
211 211
 
212 212
 		return $items;
@@ -577,8 +577,8 @@  discard block
 block discarded – undo
577 577
 				unset( $colors['primary'] );
578 578
 				$position_colors = array();
579 579
 				foreach ( $colors as $color_family ) {
580
-					if ( isset( $color_family[ $key ] ) ) {
581
-						$position_colors[] = $color_family[ $key ];
580
+					if ( isset( $color_family[$key] ) ) {
581
+						$position_colors[] = $color_family[$key];
582 582
 					}
583 583
 				}
584 584
 				return $position_colors;
@@ -594,8 +594,8 @@  discard block
 block discarded – undo
594 594
 			case 'primary':
595 595
 				return $colors['primary'];
596 596
 			default:
597
-				if ( isset( $colors[ $context ] ) ) {
598
-					return $colors[ $context ];
597
+				if ( isset( $colors[$context] ) ) {
598
+					return $colors[$context];
599 599
 				}
600 600
 				return $colors['primary'];
601 601
 		}
Please login to merge, or discard this patch.
controls/dimensions/class-kirki-control-dimensions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,14 +112,14 @@
 block discarded – undo
112 112
 		if ( is_array( $this->choices ) ) {
113 113
 			foreach ( $this->choices as $choice => $value ) {
114 114
 				if ( true === $value ) {
115
-					$this->json['choices'][ $choice ] = true;
115
+					$this->json['choices'][$choice] = true;
116 116
 				}
117 117
 			}
118 118
 		}
119 119
 		if ( is_array( $this->json['default'] ) ) {
120 120
 			foreach ( $this->json['default'] as $key => $value ) {
121
-				if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) {
122
-					$this->json['value'][ $key ] = $value;
121
+				if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) {
122
+					$this->json['value'][$key] = $value;
123 123
 				}
124 124
 			}
125 125
 		}
Please login to merge, or discard this patch.
field/class-kirki-field-dimensions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 		// Sanitize each sub-value separately.
54 54
 		foreach ( $value as $key => $sub_value ) {
55
-			$value[ $key ] = Kirki_Sanitize_Values::css_dimension( $sub_value );
55
+			$value[$key] = Kirki_Sanitize_Values::css_dimension( $sub_value );
56 56
 		}
57 57
 		return $value;
58 58
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		$this->choices['controls'] = array();
70 70
 		if ( is_array( $this->default ) ) {
71 71
 			foreach ( $this->default as $key => $value ) {
72
-				$this->choices['controls'][ $key ] = true;
72
+				$this->choices['controls'][$key] = true;
73 73
 			}
74 74
 		}
75 75
 	}
Please login to merge, or discard this patch.
field/class-kirki-field-image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 		// Simple sanitization.
37 37
 		if ( ! empty( $this->button_labels ) ) {
38 38
 			foreach ( $this->button_labels as $key => $value ) {
39
-				$this->button_labels[ sanitize_key( $key ) ] = esc_attr( $value );
39
+				$this->button_labels[sanitize_key( $key )] = esc_attr( $value );
40 40
 			}
41 41
 		}
42 42
 	}
Please login to merge, or discard this patch.
core/class-kirki-enqueue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 		$configs = Kirki::$config;
45 45
 		$l10n    = array();
46 46
 		foreach ( $configs as $id => $args ) {
47
-			$l10n[ $id ] = Kirki_l10n::get_strings( $id );
47
+			$l10n[$id] = Kirki_l10n::get_strings( $id );
48 48
 		}
49 49
 
50 50
 		wp_localize_script( 'kirki-l10n', 'kirkiL10n', $l10n );
Please login to merge, or discard this patch.