@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | // Get all valid font variants for this font |
| 68 | 68 | $font_variants = array(); |
| 69 | - if ( isset( $google_fonts[ $family ]['variants'] ) ) { |
|
| 70 | - $font_variants = $google_fonts[ $family ]['variants']; |
|
| 69 | + if ( isset( $google_fonts[$family]['variants'] ) ) { |
|
| 70 | + $font_variants = $google_fonts[$family]['variants']; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // format the requested variant |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | // Get all available subsets for this font |
| 83 | 83 | $font_subsets = array(); |
| 84 | - if ( isset( $google_fonts[ $family ]['subsets'] ) ) { |
|
| 85 | - $font_subsets = $google_fonts[ $family ]['subsets']; |
|
| 84 | + if ( isset( $google_fonts[$family]['subsets'] ) ) { |
|
| 85 | + $font_subsets = $google_fonts[$family]['subsets']; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // Get the valid subsets for this font |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | $requested_subsets = $font_subsets; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - self::$fonts[ $family ] = array( |
|
| 96 | + self::$fonts[$family] = array( |
|
| 97 | 97 | 'subsets' => $requested_subsets, |
| 98 | 98 | ); |
| 99 | - if ( ! isset( self::$fonts[ $family ]['variants'] ) ) { |
|
| 100 | - self::$fonts[ $family ]['variants'] = array(); |
|
| 99 | + if ( ! isset( self::$fonts[$family]['variants'] ) ) { |
|
| 100 | + self::$fonts[$family]['variants'] = array(); |
|
| 101 | 101 | } |
| 102 | 102 | if ( $variant_is_valid ) { |
| 103 | - self::$fonts[ $family ]['variants'][] =$requested_variant; |
|
| 103 | + self::$fonts[$family]['variants'][] = $requested_variant; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | } |
@@ -215,59 +215,59 @@ discard block |
||
| 215 | 215 | if ( 'font-family' == $output['property'] ) { |
| 216 | 216 | // Add backup font |
| 217 | 217 | if ( Kirki_Fonts::is_google_font( $value ) ) { |
| 218 | - if ( isset( $google_fonts_array[ $value ] ) && isset( $google_fonts_array[ $value ]['category'] ) ) { |
|
| 219 | - if ( isset( $backup_fonts[ $google_fonts_array[ $value ]['category'] ] ) ) { |
|
| 218 | + if ( isset( $google_fonts_array[$value] ) && isset( $google_fonts_array[$value]['category'] ) ) { |
|
| 219 | + if ( isset( $backup_fonts[$google_fonts_array[$value]['category']] ) ) { |
|
| 220 | 220 | // add double quotes if needed |
| 221 | 221 | if ( false !== strpos( $value, ' ' ) && false === strpos( $value, '"' ) ) { |
| 222 | - $value = '"' . $value . '", ' . $backup_fonts[ $google_fonts_array[ $value ]['category'] ]; |
|
| 222 | + $value = '"' . $value . '", ' . $backup_fonts[$google_fonts_array[$value]['category']]; |
|
| 223 | 223 | } else { |
| 224 | - $value .= ', ' . $backup_fonts[ $google_fonts_array[ $value ]['category'] ]; |
|
| 224 | + $value .= ', ' . $backup_fonts[$google_fonts_array[$value]['category']]; |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | - $styles[ $output['media_query'] ][ $element ][ $output['property'] ] = $prefix . $value . $units . $suffix; |
|
| 230 | + $styles[$output['media_query']][$element][$output['property']] = $prefix . $value . $units . $suffix; |
|
| 231 | 231 | } else { |
| 232 | 232 | /** |
| 233 | 233 | * Take care of typography controls output |
| 234 | 234 | */ |
| 235 | 235 | if ( 'typography' == self::$field_type ) { |
| 236 | 236 | if ( isset( $value['bold'] ) && $value['bold'] ) { |
| 237 | - $styles[ $output['media_query'] ][ $element ]['font-weight'] = 'bold'; |
|
| 237 | + $styles[$output['media_query']][$element]['font-weight'] = 'bold'; |
|
| 238 | 238 | } |
| 239 | 239 | if ( isset( $value['italic'] ) && $value['italic'] ) { |
| 240 | - $styles[ $output['media_query'] ][ $element ]['font-style'] = 'italic'; |
|
| 240 | + $styles[$output['media_query']][$element]['font-style'] = 'italic'; |
|
| 241 | 241 | } |
| 242 | 242 | if ( isset( $value['underline'] ) && $value['underline'] ) { |
| 243 | - $styles[ $output['media_query'] ][ $element ]['text-decoration'] = 'underline'; |
|
| 243 | + $styles[$output['media_query']][$element]['text-decoration'] = 'underline'; |
|
| 244 | 244 | } |
| 245 | 245 | if ( isset( $value['strikethrough'] ) && $value['strikethrough'] ) { |
| 246 | - $styles[ $output['media_query'] ][ $element ]['text-decoration'] = 'strikethrough'; |
|
| 246 | + $styles[$output['media_query']][$element]['text-decoration'] = 'strikethrough'; |
|
| 247 | 247 | } |
| 248 | 248 | if ( isset( $value['font-family'] ) ) { |
| 249 | 249 | // add double quotes if needed |
| 250 | 250 | if ( false !== strpos( $value['font-family'], ' ' ) && false === strpos( $value['font-family'], '"' ) ) { |
| 251 | - $styles[ $output['media_query'] ][ $element ]['font-family'] = '"' . $value['font-family'] . '"'; |
|
| 251 | + $styles[$output['media_query']][$element]['font-family'] = '"' . $value['font-family'] . '"'; |
|
| 252 | 252 | } else { |
| 253 | - $styles[ $output['media_query'] ][ $element ]['font-family'] = $value['font-family']; |
|
| 253 | + $styles[$output['media_query']][$element]['font-family'] = $value['font-family']; |
|
| 254 | 254 | } |
| 255 | 255 | // Add backup font |
| 256 | 256 | if ( Kirki_Fonts::is_google_font( $value['font-family'] ) ) { |
| 257 | - if ( isset( $google_fonts_array[ $value['font-family'] ] ) && isset( $google_fonts_array[ $value['font-family'] ]['category'] ) ) { |
|
| 258 | - if ( isset( $backup_fonts[ $google_fonts_array[ $value['font-family'] ]['category'] ] ) ) { |
|
| 257 | + if ( isset( $google_fonts_array[$value['font-family']] ) && isset( $google_fonts_array[$value['font-family']]['category'] ) ) { |
|
| 258 | + if ( isset( $backup_fonts[$google_fonts_array[$value['font-family']]['category']] ) ) { |
|
| 259 | 259 | // add double quotes if needed |
| 260 | 260 | if ( false !== strpos( $value['font-family'], ' ' ) && false === strpos( $value['font-family'], '"' ) ) { |
| 261 | - $styles[ $output['media_query'] ][ $element ]['font-family'] = '"' . $value['font-family'] . '", ' . $backup_fonts[ $google_fonts_array[ $value['font-family'] ]['category'] ]; |
|
| 261 | + $styles[$output['media_query']][$element]['font-family'] = '"' . $value['font-family'] . '", ' . $backup_fonts[$google_fonts_array[$value['font-family']]['category']]; |
|
| 262 | 262 | } else { |
| 263 | - $styles[ $output['media_query'] ][ $element ]['font-family'] = $value['font-family'] . ', ' . $backup_fonts[ $google_fonts_array[ $value['font-family'] ]['category'] ]; |
|
| 263 | + $styles[$output['media_query']][$element]['font-family'] = $value['font-family'] . ', ' . $backup_fonts[$google_fonts_array[$value['font-family']]['category']]; |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | foreach ( $value as $key => $sub_value ) { |
| 270 | - $styles[ $output['media_query'] ][ $element ][ $key ] = $sub_value; |
|
| 270 | + $styles[$output['media_query']][$element][$key] = $sub_value; |
|
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | /** |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | } else { |
| 281 | 281 | $property = $output['property'] . '-' . $key; |
| 282 | 282 | } |
| 283 | - $styles[ $output['media_query'] ][ $element ][ $property ] = $sub_value; |
|
| 283 | + $styles[$output['media_query']][$element][$property] = $sub_value; |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | } |
@@ -306,65 +306,65 @@ discard block |
||
| 306 | 306 | * border-radius |
| 307 | 307 | */ |
| 308 | 308 | if ( 'border-radius' == $property ) { |
| 309 | - $css[ $media_query ][ $element ]['-webkit-border-radius'] = $value; |
|
| 310 | - $css[ $media_query ][ $element ]['-moz-border-radius'] = $value; |
|
| 309 | + $css[$media_query][$element]['-webkit-border-radius'] = $value; |
|
| 310 | + $css[$media_query][$element]['-moz-border-radius'] = $value; |
|
| 311 | 311 | } |
| 312 | 312 | /** |
| 313 | 313 | * box-shadow |
| 314 | 314 | */ |
| 315 | 315 | if ( 'box-shadow' == $property ) { |
| 316 | - $css[ $media_query ][ $element ]['-webkit-box-shadow'] = $value; |
|
| 317 | - $css[ $media_query ][ $element ]['-moz-box-shadow'] = $value; |
|
| 316 | + $css[$media_query][$element]['-webkit-box-shadow'] = $value; |
|
| 317 | + $css[$media_query][$element]['-moz-box-shadow'] = $value; |
|
| 318 | 318 | } |
| 319 | 319 | /** |
| 320 | 320 | * box-sizing |
| 321 | 321 | */ |
| 322 | 322 | elseif ( 'box-sizing' == $property ) { |
| 323 | - $css[ $media_query ][ $element ]['-webkit-box-sizing'] = $value; |
|
| 324 | - $css[ $media_query ][ $element ]['-moz-box-sizing'] = $value; |
|
| 323 | + $css[$media_query][$element]['-webkit-box-sizing'] = $value; |
|
| 324 | + $css[$media_query][$element]['-moz-box-sizing'] = $value; |
|
| 325 | 325 | } |
| 326 | 326 | /** |
| 327 | 327 | * text-shadow |
| 328 | 328 | */ |
| 329 | 329 | elseif ( 'text-shadow' == $property ) { |
| 330 | - $css[ $media_query ][ $element ]['-webkit-text-shadow'] = $value; |
|
| 331 | - $css[ $media_query ][ $element ]['-moz-text-shadow'] = $value; |
|
| 330 | + $css[$media_query][$element]['-webkit-text-shadow'] = $value; |
|
| 331 | + $css[$media_query][$element]['-moz-text-shadow'] = $value; |
|
| 332 | 332 | } |
| 333 | 333 | /** |
| 334 | 334 | * transform |
| 335 | 335 | */ |
| 336 | 336 | elseif ( 'transform' == $property ) { |
| 337 | - $css[ $media_query ][ $element ]['-webkit-transform'] = $value; |
|
| 338 | - $css[ $media_query ][ $element ]['-moz-transform'] = $value; |
|
| 339 | - $css[ $media_query ][ $element ]['-ms-transform'] = $value; |
|
| 340 | - $css[ $media_query ][ $element ]['-o-transform'] = $value; |
|
| 337 | + $css[$media_query][$element]['-webkit-transform'] = $value; |
|
| 338 | + $css[$media_query][$element]['-moz-transform'] = $value; |
|
| 339 | + $css[$media_query][$element]['-ms-transform'] = $value; |
|
| 340 | + $css[$media_query][$element]['-o-transform'] = $value; |
|
| 341 | 341 | } |
| 342 | 342 | /** |
| 343 | 343 | * background-size |
| 344 | 344 | */ |
| 345 | 345 | elseif ( 'background-size' == $property ) { |
| 346 | - $css[ $media_query ][ $element ]['-webkit-background-size'] = $value; |
|
| 347 | - $css[ $media_query ][ $element ]['-moz-background-size'] = $value; |
|
| 348 | - $css[ $media_query ][ $element ]['-ms-background-size'] = $value; |
|
| 349 | - $css[ $media_query ][ $element ]['-o-background-size'] = $value; |
|
| 346 | + $css[$media_query][$element]['-webkit-background-size'] = $value; |
|
| 347 | + $css[$media_query][$element]['-moz-background-size'] = $value; |
|
| 348 | + $css[$media_query][$element]['-ms-background-size'] = $value; |
|
| 349 | + $css[$media_query][$element]['-o-background-size'] = $value; |
|
| 350 | 350 | } |
| 351 | 351 | /** |
| 352 | 352 | * transition |
| 353 | 353 | */ |
| 354 | 354 | elseif ( 'transition' == $property ) { |
| 355 | - $css[ $media_query ][ $element ]['-webkit-transition'] = $value; |
|
| 356 | - $css[ $media_query ][ $element ]['-moz-transition'] = $value; |
|
| 357 | - $css[ $media_query ][ $element ]['-ms-transition'] = $value; |
|
| 358 | - $css[ $media_query ][ $element ]['-o-transition'] = $value; |
|
| 355 | + $css[$media_query][$element]['-webkit-transition'] = $value; |
|
| 356 | + $css[$media_query][$element]['-moz-transition'] = $value; |
|
| 357 | + $css[$media_query][$element]['-ms-transition'] = $value; |
|
| 358 | + $css[$media_query][$element]['-o-transition'] = $value; |
|
| 359 | 359 | } |
| 360 | 360 | /** |
| 361 | 361 | * transition-property |
| 362 | 362 | */ |
| 363 | 363 | elseif ( 'transition-property' == $property ) { |
| 364 | - $css[ $media_query ][ $element ]['-webkit-transition-property'] = $value; |
|
| 365 | - $css[ $media_query ][ $element ]['-moz-transition-property'] = $value; |
|
| 366 | - $css[ $media_query ][ $element ]['-ms-transition-property'] = $value; |
|
| 367 | - $css[ $media_query ][ $element ]['-o-transition-property'] = $value; |
|
| 364 | + $css[$media_query][$element]['-webkit-transition-property'] = $value; |
|
| 365 | + $css[$media_query][$element]['-moz-transition-property'] = $value; |
|
| 366 | + $css[$media_query][$element]['-ms-transition-property'] = $value; |
|
| 367 | + $css[$media_query][$element]['-o-transition-property'] = $value; |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | } |