Completed
Push — develop ( 61b328...1a3f9c )
by Aristeides
02:36
created
modules/webfonts/class-kirki-fonts-google.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 			}
142 142
 
143 143
 			// Add the requested google-font.
144
-			if ( ! isset( $this->fonts[ $value['font-family'] ] ) ) {
145
-				$this->fonts[ $value['font-family'] ] = array();
144
+			if ( ! isset( $this->fonts[$value['font-family']] ) ) {
145
+				$this->fonts[$value['font-family']] = array();
146 146
 			}
147
-			if ( ! in_array( $value['variant'], $this->fonts[ $value['font-family'] ], true ) ) {
148
-				$this->fonts[ $value['font-family'] ][] = $value['variant'];
147
+			if ( ! in_array( $value['variant'], $this->fonts[$value['font-family']], true ) ) {
148
+				$this->fonts[$value['font-family']][] = $value['variant'];
149 149
 			}
150 150
 			if ( ! empty( $args['choices']['variant'] ) ) {
151 151
 				foreach ( $args['choices']['variant'] as $extra_variant ) {
152
-					$this->fonts[ $value['font-family'] ][] = $extra_variant;
152
+					$this->fonts[$value['font-family']][] = $extra_variant;
153 153
 				}
154 154
 			}
155 155
 		} else {
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 					if ( is_string( $value ) ) {
170 170
 						if ( 'font-family' === $output['property'] ) {
171 171
 							if ( ! array_key_exists( $value, $this->fonts ) ) {
172
-								$this->fonts[ $value ] = array();
172
+								$this->fonts[$value] = array();
173 173
 							}
174 174
 						} elseif ( 'font-weight' === $output['property'] ) {
175 175
 							foreach ( $this->fonts as $font => $variants ) {
176 176
 								if ( ! in_array( $value, $variants, true ) ) {
177
-									$this->fonts[ $font ][] = $value;
177
+									$this->fonts[$font][] = $value;
178 178
 								}
179 179
 							}
180 180
 						} elseif ( 'font-subset' === $output['property'] || 'subset' === $output['property'] || 'subsets' === $output['property'] ) {
@@ -214,31 +214,31 @@  discard block
 block discarded – undo
214 214
 			// Determine if this is indeed a google font or not.
215 215
 			// If it's not, then just remove it from the array.
216 216
 			if ( ! array_key_exists( $font, $this->google_fonts ) ) {
217
-				unset( $this->fonts[ $font ] );
217
+				unset( $this->fonts[$font] );
218 218
 				continue;
219 219
 			}
220 220
 
221 221
 			// Get all valid font variants for this font.
222 222
 			$font_variants = array();
223
-			if ( isset( $this->google_fonts[ $font ]['variants'] ) ) {
224
-				$font_variants = $this->google_fonts[ $font ]['variants'];
223
+			if ( isset( $this->google_fonts[$font]['variants'] ) ) {
224
+				$font_variants = $this->google_fonts[$font]['variants'];
225 225
 			}
226 226
 			foreach ( $variants as $variant ) {
227 227
 
228 228
 				// If this is not a valid variant for this font-family
229 229
 				// then unset it and move on to the next one.
230 230
 				if ( ! in_array( $variant, $font_variants, true ) ) {
231
-					$variant_key = array_search( $variant, $this->fonts[ $font ], true );
232
-					unset( $this->fonts[ $font ][ $variant_key ] );
231
+					$variant_key = array_search( $variant, $this->fonts[$font], true );
232
+					unset( $this->fonts[$font][$variant_key] );
233 233
 					continue;
234 234
 				}
235 235
 			}
236 236
 
237 237
 			// Check if the selected subsets exist, even in one of the selected fonts.
238 238
 			// If they don't, then they have to be removed otherwise the link will fail.
239
-			if ( isset( $this->google_fonts[ $font ]['subsets'] ) ) {
239
+			if ( isset( $this->google_fonts[$font]['subsets'] ) ) {
240 240
 				foreach ( $this->subsets as $subset ) {
241
-					if ( in_array( $subset, $this->google_fonts[ $font ]['subsets'], true ) ) {
241
+					if ( in_array( $subset, $this->google_fonts[$font]['subsets'], true ) ) {
242 242
 						$valid_subsets[] = $subset;
243 243
 					}
244 244
 				}
Please login to merge, or discard this patch.