@@ -36,14 +36,14 @@ |
||
| 36 | 36 | // Add backup font. |
| 37 | 37 | if ( Kirki_Fonts::is_google_font( $this->value ) ) { |
| 38 | 38 | |
| 39 | - if ( isset( $google_fonts_array[ $this->value ] ) && isset( $google_fonts_array[ $this->value ]['category'] ) ) { |
|
| 40 | - if ( isset( $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ] ) ) { |
|
| 39 | + if ( isset( $google_fonts_array[$this->value] ) && isset( $google_fonts_array[$this->value]['category'] ) ) { |
|
| 40 | + if ( isset( $backup_fonts[$google_fonts_array[$this->value]['category']] ) ) { |
|
| 41 | 41 | |
| 42 | 42 | // Add double quotes if needed. |
| 43 | 43 | if ( false !== strpos( $this->value, ' ' ) && false === strpos( $this->value, '"' ) ) { |
| 44 | - $this->value = '"' . $this->value . '", ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
| 44 | + $this->value = '"' . $this->value . '", ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
| 45 | 45 | } else { |
| 46 | - $this->value .= ', ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
| 46 | + $this->value .= ', ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @access public |
| 38 | 38 | * @var null|string|array |
| 39 | 39 | */ |
| 40 | - public static $settings = null; |
|
| 40 | + public static $settings = null; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Output. |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @access public |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - public static $output = array(); |
|
| 49 | + public static $output = array(); |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Callback. |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @access public |
| 56 | 56 | * @var null|string|array |
| 57 | 57 | */ |
| 58 | - public static $callback = null; |
|
| 58 | + public static $callback = null; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Option Name. |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @access public |
| 74 | 74 | * @var string |
| 75 | 75 | */ |
| 76 | - public static $field_type = null; |
|
| 76 | + public static $field_type = null; |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Google Fonts |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | 'kirki-multicolor' => 'Kirki_Output_Field_Multicolor', |
| 172 | 172 | ) ); |
| 173 | 173 | if ( array_key_exists( self::$field_type, $field_output_classes ) ) { |
| 174 | - $classname = $field_output_classes[ self::$field_type ]; |
|
| 174 | + $classname = $field_output_classes[self::$field_type]; |
|
| 175 | 175 | } |
| 176 | 176 | $obj = new $classname( $field['kirki_config'], self::$output, self::$value ); |
| 177 | 177 | return $obj->get_styles(); |
@@ -235,10 +235,10 @@ discard block |
||
| 235 | 235 | 'transition', |
| 236 | 236 | 'transition-property', |
| 237 | 237 | ) ) ) { |
| 238 | - unset( $css[ $media_query ][ $element ][ $property ] ); |
|
| 239 | - $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; |
|
| 240 | - $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; |
|
| 241 | - $css[ $media_query ][ $element ][ $property ] = $value; |
|
| 238 | + unset( $css[$media_query][$element][$property] ); |
|
| 239 | + $css[$media_query][$element]['-webkit-' . $property] = $value; |
|
| 240 | + $css[$media_query][$element]['-moz-' . $property] = $value; |
|
| 241 | + $css[$media_query][$element][$property] = $value; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // Add -ms-* and -o-*. |
@@ -248,10 +248,10 @@ discard block |
||
| 248 | 248 | 'transition', |
| 249 | 249 | 'transition-property', |
| 250 | 250 | ) ) ) { |
| 251 | - unset( $css[ $media_query ][ $element ][ $property ] ); |
|
| 252 | - $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; |
|
| 253 | - $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; |
|
| 254 | - $css[ $media_query ][ $element ][ $property ] = $value; |
|
| 251 | + unset( $css[$media_query][$element][$property] ); |
|
| 252 | + $css[$media_query][$element]['-ms-' . $property] = $value; |
|
| 253 | + $css[$media_query][$element]['-o-' . $property] = $value; |
|
| 254 | + $css[$media_query][$element][$property] = $value; |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | } |
@@ -250,11 +250,11 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | // Add the requested google-font. |
| 253 | - if ( ! isset( $this->fonts[ $value['font-family'] ] ) ) { |
|
| 254 | - $this->fonts[ $value['font-family'] ] = array(); |
|
| 253 | + if ( ! isset( $this->fonts[$value['font-family']] ) ) { |
|
| 254 | + $this->fonts[$value['font-family']] = array(); |
|
| 255 | 255 | } |
| 256 | - if ( ! in_array( $value['variant'], $this->fonts[ $value['font-family'] ], true ) ) { |
|
| 257 | - $this->fonts[ $value['font-family'] ][] = $value['variant']; |
|
| 256 | + if ( ! in_array( $value['variant'], $this->fonts[$value['font-family']], true ) ) { |
|
| 257 | + $this->fonts[$value['font-family']][] = $value['variant']; |
|
| 258 | 258 | } |
| 259 | 259 | } else { |
| 260 | 260 | |
@@ -272,12 +272,12 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | if ( 'font-family' === $output['property'] ) { |
| 274 | 274 | if ( ! array_key_exists( $value, $this->fonts ) ) { |
| 275 | - $this->fonts[ $value ] = array(); |
|
| 275 | + $this->fonts[$value] = array(); |
|
| 276 | 276 | } |
| 277 | 277 | } elseif ( 'font-weight' === $output['property'] ) { |
| 278 | 278 | foreach ( $this->fonts as $font => $variants ) { |
| 279 | 279 | if ( ! in_array( $value, $variants, true ) ) { |
| 280 | - $this->fonts[ $font ][] = $value; |
|
| 280 | + $this->fonts[$font][] = $value; |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | } elseif ( 'font-subset' === $output['property'] || 'subset' === $output['property'] || 'subsets' === $output['property'] ) { |
@@ -316,31 +316,31 @@ discard block |
||
| 316 | 316 | // Determine if this is indeed a google font or not. |
| 317 | 317 | // If it's not, then just remove it from the array. |
| 318 | 318 | if ( ! array_key_exists( $font, $this->google_fonts ) ) { |
| 319 | - unset( $this->fonts[ $font ] ); |
|
| 319 | + unset( $this->fonts[$font] ); |
|
| 320 | 320 | continue; |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | // Get all valid font variants for this font. |
| 324 | 324 | $font_variants = array(); |
| 325 | - if ( isset( $this->google_fonts[ $font ]['variants'] ) ) { |
|
| 326 | - $font_variants = $this->google_fonts[ $font ]['variants']; |
|
| 325 | + if ( isset( $this->google_fonts[$font]['variants'] ) ) { |
|
| 326 | + $font_variants = $this->google_fonts[$font]['variants']; |
|
| 327 | 327 | } |
| 328 | 328 | foreach ( $variants as $variant ) { |
| 329 | 329 | |
| 330 | 330 | // If this is not a valid variant for this font-family |
| 331 | 331 | // then unset it and move on to the next one. |
| 332 | 332 | if ( ! in_array( $variant, $font_variants, true ) ) { |
| 333 | - $variant_key = array_search( $variant, $this->fonts[ $font ] ); |
|
| 334 | - unset( $this->fonts[ $font ][ $variant_key ] ); |
|
| 333 | + $variant_key = array_search( $variant, $this->fonts[$font] ); |
|
| 334 | + unset( $this->fonts[$font][$variant_key] ); |
|
| 335 | 335 | continue; |
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | // Check if the selected subsets exist, even in one of the selected fonts. |
| 340 | 340 | // If they don't, then they have to be removed otherwise the link will fail. |
| 341 | - if ( isset( $this->google_fonts[ $font ]['subsets'] ) ) { |
|
| 341 | + if ( isset( $this->google_fonts[$font]['subsets'] ) ) { |
|
| 342 | 342 | foreach ( $this->subsets as $subset ) { |
| 343 | - if ( in_array( $subset, $this->google_fonts[ $font ]['subsets'], true ) ) { |
|
| 343 | + if ( in_array( $subset, $this->google_fonts[$font]['subsets'], true ) ) { |
|
| 344 | 344 | $valid_subsets[] = $subset; |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | // Are we force-loading all variants? |
| 370 | 370 | if ( true === self::$force_load_all_variants ) { |
| 371 | - if ( isset( $this->google_fonts[ $font ]['variants'] ) ) { |
|
| 372 | - $variants = $this->google_fonts[ $font ]['variants']; |
|
| 371 | + if ( isset( $this->google_fonts[$font]['variants'] ) ) { |
|
| 372 | + $variants = $this->google_fonts[$font]['variants']; |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | $variants = implode( ',', $variants ); |
@@ -384,8 +384,8 @@ discard block |
||
| 384 | 384 | // Are we force-loading all subsets? |
| 385 | 385 | if ( true === self::$force_load_all_subsets ) { |
| 386 | 386 | |
| 387 | - if ( isset( $this->google_fonts[ $font ]['subsets'] ) ) { |
|
| 388 | - foreach ( $this->google_fonts[ $font ]['subsets'] as $subset ) { |
|
| 387 | + if ( isset( $this->google_fonts[$font]['subsets'] ) ) { |
|
| 388 | + foreach ( $this->google_fonts[$font]['subsets'] as $subset ) { |
|
| 389 | 389 | $this->subsets[] = $subset; |
| 390 | 390 | } |
| 391 | 391 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ( ! in_array( $method, $valid_methods ) ) { |
| 423 | 423 | $method = 'embed'; |
| 424 | 424 | } |
| 425 | - self::$method[ $config_id ] = $method; |
|
| 425 | + self::$method[$config_id] = $method; |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |