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