Passed
Pull Request — master (#1930)
by Aristeides
04:14
created
modules/css/class-kirki-modules-css.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 
120 120
 		$config   = apply_filters( 'kirki_config', array() );
121 121
 		$priority = 999;
122
-		if ( isset( $config['styles_priority'] ) ) {
123
-			$priority = absint( $config['styles_priority'] );
122
+		if ( isset( $config[ 'styles_priority' ] ) ) {
123
+			$priority = absint( $config[ 'styles_priority' ] );
124 124
 		}
125 125
 
126 126
 		// Allow completely disabling Kirki CSS output.
127
-		if ( ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) || ( isset( $config['disable_output'] ) && true === $config['disable_output'] ) ) {
127
+		if ( ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) || ( isset( $config[ 'disable_output' ] ) && true === $config[ 'disable_output' ] ) ) {
128 128
 			return;
129 129
 		}
130 130
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 		// If we are in the customizer, load CSS using inline-styles.
157 157
 		// If we are in the frontend AND self::$ajax is true, then load dynamic CSS using AJAX.
158
-		if ( ( true === self::$ajax ) || ( isset( $config['inline_css'] ) && false === $config['inline_css'] ) ) {
158
+		if ( ( true === self::$ajax ) || ( isset( $config[ 'inline_css' ] ) && false === $config[ 'inline_css' ] ) ) {
159 159
 			add_action( 'wp_enqueue_scripts', array( $this, 'frontend_styles' ), $priority );
160 160
 			add_action( 'wp_ajax_kirki_dynamic_css', array( $this, 'ajax_dynamic_css' ) );
161 161
 			add_action( 'wp_ajax_nopriv_kirki_dynamic_css', array( $this, 'ajax_dynamic_css' ) );
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		$configs = Kirki::$config;
187 187
 		if ( ! $this->processed ) {
188 188
 			foreach ( $configs as $config_id => $args ) {
189
-				if ( isset( $args['disable_output'] ) && true === $args['disable_output'] ) {
189
+				if ( isset( $args[ 'disable_output' ] ) && true === $args[ 'disable_output' ] ) {
190 190
 					continue;
191 191
 				}
192 192
 				$styles = self::loop_controls( $config_id );
@@ -243,19 +243,19 @@  discard block
 block discarded – undo
243 243
 		foreach ( $fields as $field ) {
244 244
 
245 245
 			// Only process fields that belong to $config_id.
246
-			if ( $config_id !== $field['kirki_config'] ) {
246
+			if ( $config_id !== $field[ 'kirki_config' ] ) {
247 247
 				continue;
248 248
 			}
249 249
 
250 250
 			if ( true === apply_filters( "kirki_{$config_id}_css_skip_hidden", true ) ) {
251 251
 				// Only continue if field dependencies are met.
252
-				if ( ! empty( $field['required'] ) ) {
252
+				if ( ! empty( $field[ 'required' ] ) ) {
253 253
 					$valid = true;
254 254
 
255
-					foreach ( $field['required'] as $requirement ) {
256
-						if ( isset( $requirement['setting'] ) && isset( $requirement['value'] ) && isset( $requirement['operator'] ) ) {
257
-							$controller_value = Kirki_Values::get_value( $config_id, $requirement['setting'] );
258
-							if ( ! Kirki_Helper::compare_values( $controller_value, $requirement['value'], $requirement['operator'] ) ) {
255
+					foreach ( $field[ 'required' ] as $requirement ) {
256
+						if ( isset( $requirement[ 'setting' ] ) && isset( $requirement[ 'value' ] ) && isset( $requirement[ 'operator' ] ) ) {
257
+							$controller_value = Kirki_Values::get_value( $config_id, $requirement[ 'setting' ] );
258
+							if ( ! Kirki_Helper::compare_values( $controller_value, $requirement[ 'value' ], $requirement[ 'operator' ] ) ) {
259 259
 								$valid = false;
260 260
 							}
261 261
 						}
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 			}
269 269
 
270 270
 			// Only continue if $field['output'] is set.
271
-			if ( isset( $field['output'] ) && ! empty( $field['output'] ) ) {
271
+			if ( isset( $field[ 'output' ] ) && ! empty( $field[ 'output' ] ) ) {
272 272
 				$css = Kirki_Helper::array_replace_recursive( $css, Kirki_Modules_CSS_Generator::css( $field ) );
273 273
 
274 274
 				// Add the globals.
Please login to merge, or discard this patch.
modules/tooltips/class-kirki-modules-tooltips.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,13 +76,13 @@
 block discarded – undo
76 76
 
77 77
 		$fields = Kirki::$fields;
78 78
 		foreach ( $fields as $field ) {
79
-			if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) {
79
+			if ( isset( $field[ 'tooltip' ] ) && ! empty( $field[ 'tooltip' ] ) ) {
80 80
 				// Get the control ID and properly format it for the tooltips
81
-				$id = str_replace( '[', '-', str_replace( ']', '', $field['settings'] ) );
81
+				$id = str_replace( '[', '-', str_replace( ']', '', $field[ 'settings' ] ) );
82 82
 				// Add the tooltips content.
83 83
 				$this->tooltips_content[ $id ] = array(
84 84
 					'id'      => $id,
85
-					'content' => wp_kses_post( $field['tooltip'] ),
85
+					'content' => wp_kses_post( $field[ 'tooltip' ] ),
86 86
 				);
87 87
 			}
88 88
 		}
Please login to merge, or discard this patch.
controls/php/class-kirki-control-repeater.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -76,28 +76,28 @@  discard block
 block discarded – undo
76 76
 
77 77
 		if ( empty( $this->button_label ) ) {
78 78
 			/* translators: %s represents the label of the row. */
79
-			$this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label['value'] );
79
+			$this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label[ 'value' ] );
80 80
 		}
81 81
 
82
-		if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) {
83
-			$args['fields'] = array();
82
+		if ( empty( $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) {
83
+			$args[ 'fields' ] = array();
84 84
 		}
85 85
 
86 86
 		// An array to store keys of fields that need to be filtered.
87 87
 		$media_fields_to_filter = array();
88 88
 
89
-		foreach ( $args['fields'] as $key => $value ) {
90
-			if ( ! isset( $value['default'] ) ) {
91
-				$args['fields'][ $key ]['default'] = '';
89
+		foreach ( $args[ 'fields' ] as $key => $value ) {
90
+			if ( ! isset( $value[ 'default' ] ) ) {
91
+				$args[ 'fields' ][ $key ][ 'default' ] = '';
92 92
 			}
93
-			if ( ! isset( $value['label'] ) ) {
94
-				$args['fields'][ $key ]['label'] = '';
93
+			if ( ! isset( $value[ 'label' ] ) ) {
94
+				$args[ 'fields' ][ $key ][ 'label' ] = '';
95 95
 			}
96
-			$args['fields'][ $key ]['id'] = $key;
96
+			$args[ 'fields' ][ $key ][ 'id' ] = $key;
97 97
 
98 98
 			// We check if the filed is an uploaded media ( image , file, video, etc.. ).
99
-			if ( isset( $value['type'] ) ) {
100
-				switch ( $value['type'] ) {
99
+			if ( isset( $value[ 'type' ] ) ) {
100
+				switch ( $value[ 'type' ] ) {
101 101
 					case 'image':
102 102
 					case 'cropped_image':
103 103
 					case 'upload':
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 							)
118 118
 						);
119 119
 						// Hackily add in the data link parameter.
120
-						$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
121
-						$args['fields'][ $key ]['dropdown'] = $dropdown;
120
+						$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args[ 'fields' ][ $key ][ 'id' ] ) . '"' . $this->get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
121
+						$args[ 'fields' ][ $key ][ 'dropdown' ] = $dropdown;
122 122
 						break;
123 123
 				}
124 124
 			}
125 125
 		} // End foreach().
126 126
 
127
-		$this->fields = $args['fields'];
127
+		$this->fields = $args[ 'fields' ];
128 128
 
129 129
 		// Now we are going to filter the fields.
130 130
 		// First we create a copy of the value that would be used otherwise.
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 
185 185
 		$fields = $this->fields;
186 186
 
187
-		$this->json['fields']    = $fields;
188
-		$this->json['row_label'] = $this->row_label;
187
+		$this->json[ 'fields' ]    = $fields;
188
+		$this->json[ 'row_label' ] = $this->row_label;
189 189
 
190 190
 		// If filtered_value has been set and is not empty we use it instead of the actual value.
191 191
 		if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) {
192
-			$this->json['value'] = $this->filtered_value;
192
+			$this->json[ 'value' ] = $this->filtered_value;
193 193
 		}
194
-		$this->json['value'] = apply_filters( "kirki_controls_repeater_value_{$this->id}", $this->json['value'] );
194
+		$this->json[ 'value' ] = apply_filters( "kirki_controls_repeater_value_{$this->id}", $this->json[ 'value' ] );
195 195
 	}
196 196
 
197 197
 	/**
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 		<ul class="repeater-fields"></ul>
216 216
 
217
-		<?php if ( isset( $this->choices['limit'] ) ) : ?>
217
+		<?php if ( isset( $this->choices[ 'limit' ] ) ) : ?>
218 218
 			<?php // @codingStandardsIgnoreLine ?>
219 219
 			<?php /* translators: %s represents the number of rows we're limiting the repeater to allow. */ ?>
220
-			<p class="limit"><?php printf( esc_attr__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices['limit'] ) ); ?></p>
220
+			<p class="limit"><?php printf( esc_attr__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices[ 'limit' ] ) ); ?></p>
221 221
 		<?php endif; ?>
222 222
 		<button class="button-secondary repeater-add"><?php echo esc_html( $this->button_label ); ?></button>
223 223
 
@@ -447,24 +447,24 @@  discard block
 block discarded – undo
447 447
 	protected function row_label( $args ) {
448 448
 
449 449
 		// Validating args for row labels.
450
-		if ( isset( $args['row_label'] ) && is_array( $args['row_label'] ) && ! empty( $args['row_label'] ) ) {
450
+		if ( isset( $args[ 'row_label' ] ) && is_array( $args[ 'row_label' ] ) && ! empty( $args[ 'row_label' ] ) ) {
451 451
 
452 452
 			// Validating row label type.
453
-			if ( isset( $args['row_label']['type'] ) && ( 'text' === $args['row_label']['type'] || 'field' === $args['row_label']['type'] ) ) {
454
-				$this->row_label['type'] = $args['row_label']['type'];
453
+			if ( isset( $args[ 'row_label' ][ 'type' ] ) && ( 'text' === $args[ 'row_label' ][ 'type' ] || 'field' === $args[ 'row_label' ][ 'type' ] ) ) {
454
+				$this->row_label[ 'type' ] = $args[ 'row_label' ][ 'type' ];
455 455
 			}
456 456
 
457 457
 			// Validating row label type.
458
-			if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) {
459
-				$this->row_label['value'] = esc_attr( $args['row_label']['value'] );
458
+			if ( isset( $args[ 'row_label' ][ 'value' ] ) && ! empty( $args[ 'row_label' ][ 'value' ] ) ) {
459
+				$this->row_label[ 'value' ] = esc_attr( $args[ 'row_label' ][ 'value' ] );
460 460
 			}
461 461
 
462 462
 			// Validating row label field.
463
-			if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) {
464
-				$this->row_label['field'] = esc_attr( $args['row_label']['field'] );
463
+			if ( isset( $args[ 'row_label' ][ 'field' ] ) && ! empty( $args[ 'row_label' ][ 'field' ] ) && isset( $args[ 'fields' ][ esc_attr( $args[ 'row_label' ][ 'field' ] ) ] ) ) {
464
+				$this->row_label[ 'field' ] = esc_attr( $args[ 'row_label' ][ 'field' ] );
465 465
 			} else {
466 466
 				// If from field is not set correctly, making sure standard is set as the type.
467
-				$this->row_label['type'] = 'text';
467
+				$this->row_label[ 'type' ] = 'text';
468 468
 			}
469 469
 		}
470 470
 	}
Please login to merge, or discard this patch.
deprecated/filters.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	$config_ids = Kirki_Config::get_config_ids();
54 54
 	global $kirki_deprecated_filters_iteration;
55 55
 	foreach ( $config_ids as $config_id ) {
56
-		foreach( array(
56
+		foreach ( array(
57 57
 			'/dynamic_css',
58 58
 			'/output/control-classnames',
59 59
 			'/css/skip_hidden',
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 			$kirki_deprecated_filters_iteration = array( $config_id, $filter_suffix );
65 65
 			add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) {
66 66
 				global $kirki_deprecated_filters_iteration;
67
-				$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
68
-				return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args );
67
+				$kirki_deprecated_filters_iteration[ 1 ] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[ 1 ] );
68
+				return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[ 0 ]}/{$kirki_deprecated_filters_iteration[ 1 ]}", $args );
69 69
 			}, 99 );
70
-			if ( false !== strpos( $kirki_deprecated_filters_iteration[1], '-' ) ) {
71
-				$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
70
+			if ( false !== strpos( $kirki_deprecated_filters_iteration[ 1 ], '-' ) ) {
71
+				$kirki_deprecated_filters_iteration[ 1 ] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[ 1 ] );
72 72
 				add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) {
73 73
 					global $kirki_deprecated_filters_iteration;
74
-					$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
75
-					return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args );
74
+					$kirki_deprecated_filters_iteration[ 1 ] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[ 1 ] );
75
+					return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[ 0 ]}/{$kirki_deprecated_filters_iteration[ 1 ]}", $args );
76 76
 				}, 99 );
77 77
 			}
78 78
 		}
Please login to merge, or discard this patch.
field/class-kirki-field-code.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 	 * @access protected
60 60
 	 */
61 61
 	protected function set_choices() {
62
-		if ( ! isset( $this->choices['language'] ) ) {
62
+		if ( ! isset( $this->choices[ 'language' ] ) ) {
63 63
 			return;
64 64
 		}
65
-		$language = $this->choices['language'];
65
+		$language = $this->choices[ 'language' ];
66 66
 		switch ( $language ) {
67 67
 			case 'json':
68 68
 			case 'xml':
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 				$language = 'text/x-' . $language;
91 91
 				break;
92 92
 		}
93
-		if ( ! isset( $this->editor_settings['codemirror'] ) ) {
94
-			$this->editor_settings['codemirror'] = array();
93
+		if ( ! isset( $this->editor_settings[ 'codemirror' ] ) ) {
94
+			$this->editor_settings[ 'codemirror' ] = array();
95 95
 		}
96
-		if ( ! isset( $this->editor_settings['codemirror']['mode'] ) ) {
97
-			$this->editor_settings['codemirror']['mode'] = $language;
96
+		if ( ! isset( $this->editor_settings[ 'codemirror' ][ 'mode' ] ) ) {
97
+			$this->editor_settings[ 'codemirror' ][ 'mode' ] = $language;
98 98
 		}
99 99
 	}
100 100
 
Please login to merge, or discard this patch.
field/class-kirki-field-image.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 		if ( ! is_array( $this->choices ) ) {
61 61
 			$this->choices = (array) $this->choices;
62 62
 		}
63
-		if ( ! isset( $this->choices['save_as'] ) ) {
64
-			$this->choices['save_as'] = 'url';
63
+		if ( ! isset( $this->choices[ 'save_as' ] ) ) {
64
+			$this->choices[ 'save_as' ] = 'url';
65 65
 		}
66
-		if ( ! isset( $this->choices['labels'] ) ) {
67
-			$this->choices['labels'] = array();
66
+		if ( ! isset( $this->choices[ 'labels' ] ) ) {
67
+			$this->choices[ 'labels' ] = array();
68 68
 		}
69 69
 		$this->set_button_labels();
70
-		$this->choices['labels'] = wp_parse_args( $this->choices['labels'], $this->button_labels );
70
+		$this->choices[ 'labels' ] = wp_parse_args( $this->choices[ 'labels' ], $this->button_labels );
71 71
 	}
72 72
 
73 73
 	/**
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function sanitize( $value ) {
95 95
 
96
-		if ( isset( $this->choices['save_as'] ) && 'array' === $this->choices['save_as'] ) {
96
+		if ( isset( $this->choices[ 'save_as' ] ) && 'array' === $this->choices[ 'save_as' ] ) {
97 97
 			return array(
98
-				'id'     => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '',
99
-				'url'    => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '',
100
-				'width'  => ( isset( $value['width'] ) && '' !== $value['width'] ) ? (int) $value['width'] : '',
101
-				'height' => ( isset( $value['height'] ) && '' !== $value['height'] ) ? (int) $value['height'] : '',
98
+				'id'     => ( isset( $value[ 'id' ] ) && '' !== $value[ 'id' ] ) ? (int) $value[ 'id' ] : '',
99
+				'url'    => ( isset( $value[ 'url' ] ) && '' !== $value[ 'url' ] ) ? esc_url_raw( $value[ 'url' ] ) : '',
100
+				'width'  => ( isset( $value[ 'width' ] ) && '' !== $value[ 'width' ] ) ? (int) $value[ 'width' ] : '',
101
+				'height' => ( isset( $value[ 'height' ] ) && '' !== $value[ 'height' ] ) ? (int) $value[ 'height' ] : '',
102 102
 			);
103 103
 		}
104
-		if ( isset( $this->choices['save_as'] ) && 'id' === $this->choices['save_as'] ) {
104
+		if ( isset( $this->choices[ 'save_as' ] ) && 'id' === $this->choices[ 'save_as' ] ) {
105 105
 			return absint( $value );
106 106
 		}
107 107
 		if ( is_string( $value ) ) {
Please login to merge, or discard this patch.
controls/php/class-kirki-control-upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
 	 */
33 33
 	public function to_json() {
34 34
 		parent::to_json();
35
-		$this->json['required'] = $this->required;
35
+		$this->json[ 'required' ] = $this->required;
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
controls/php/class-kirki-control-cropped-image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
 	 */
33 33
 	public function to_json() {
34 34
 		parent::to_json();
35
-		$this->json['required'] = $this->required;
35
+		$this->json[ 'required' ] = $this->required;
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
controls/php/class-kirki-control-typography.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
 	public function to_json() {
36 36
 		parent::to_json();
37 37
 
38
-		if ( is_array( $this->json['value'] ) ) {
39
-			foreach ( array_keys( $this->json['value'] ) as $key ) {
40
-				if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][ $key ] ) ) {
41
-					unset( $this->json['value'][ $key ] );
38
+		if ( is_array( $this->json[ 'value' ] ) ) {
39
+			foreach ( array_keys( $this->json[ 'value' ] ) as $key ) {
40
+				if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json[ 'default' ][ $key ] ) ) {
41
+					unset( $this->json[ 'value' ][ $key ] );
42 42
 				}
43 43
 				// Fix for https://wordpress.org/support/topic/white-font-after-updateing-to-3-0-16.
44
-				if ( ! isset( $this->json['default'][ $key ] ) ) {
45
-					unset( $this->json['value'][ $key ] );
44
+				if ( ! isset( $this->json[ 'default' ][ $key ] ) ) {
45
+					unset( $this->json[ 'value' ][ $key ] );
46 46
 				}
47 47
 				// Fix for https://github.com/aristath/kirki/issues/1405.
48
-				if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) {
49
-					unset( $this->json['value'][ $key ] );
48
+				if ( isset( $this->json[ 'default' ][ $key ] ) && false === $this->json[ 'default' ][ $key ] ) {
49
+					unset( $this->json[ 'value' ][ $key ] );
50 50
 				}
51 51
 			}
52 52
 		}
53 53
 
54
-		$this->json['show_variants'] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true;
54
+		$this->json[ 'show_variants' ] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true;
55 55
 	}
56 56
 
57 57
 	/**
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 		$final_variants = array();
239 239
 		foreach ( $variants as $variant ) {
240 240
 			if ( is_string( $variant ) ) {
241
-				$final_variants[] = array(
241
+				$final_variants[ ] = array(
242 242
 					'id'    => $variant,
243 243
 					'label' => isset( $all_variants[ $variant ] ) ? $all_variants[ $variant ] : $variant,
244 244
 				);
245
-			} elseif ( is_array( $variant ) && isset( $variant['id'] ) && isset( $variant['label'] ) ) {
246
-				$final_variants[] = $variant;
245
+			} elseif ( is_array( $variant ) && isset( $variant[ 'id' ] ) && isset( $variant[ 'label' ] ) ) {
246
+				$final_variants[ ] = $variant;
247 247
 			}
248 248
 		}
249 249
 		return $final_variants;
Please login to merge, or discard this patch.