@@ -86,7 +86,7 @@ |
||
86 | 86 | $weights[ $key ] = str_replace( array( 'regular', 'bold', 'italic' ), array( '400', '', 'i' ), $value ); |
87 | 87 | } |
88 | 88 | } |
89 | - $fonts_to_load[] = $font . ':' . join( ',', $weights ); |
|
89 | + $fonts_to_load[ ] = $font . ':' . join( ',', $weights ); |
|
90 | 90 | } |
91 | 91 | wp_enqueue_script( 'webfont-loader', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array(), KIRKI_VERSION ); |
92 | 92 | if ( empty( $fonts_to_load ) ) { |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function process_output( $output, $value ) { |
25 | 25 | |
26 | - $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
|
27 | - $output['element'] = ( isset( $output['element'] ) ) ? $output['element'] : 'body'; |
|
28 | - $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; |
|
29 | - $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
26 | + $output[ 'media_query' ] = ( isset( $output[ 'media_query' ] ) ) ? $output[ 'media_query' ] : 'global'; |
|
27 | + $output[ 'element' ] = ( isset( $output[ 'element' ] ) ) ? $output[ 'element' ] : 'body'; |
|
28 | + $output[ 'prefix' ] = ( isset( $output[ 'prefix' ] ) ) ? $output[ 'prefix' ] : ''; |
|
29 | + $output[ 'suffix' ] = ( isset( $output[ 'suffix' ] ) ) ? $output[ 'suffix' ] : ''; |
|
30 | 30 | |
31 | 31 | $value = Kirki_Field_Typography::sanitize( $value ); |
32 | 32 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | foreach ( $properties as $property ) { |
49 | 49 | |
50 | 50 | // Early exit if the value is not in the defaults. |
51 | - if ( ! isset( $this->field['default'][ $property ] ) ) { |
|
51 | + if ( ! isset( $this->field[ 'default' ][ $property ] ) ) { |
|
52 | 52 | continue; |
53 | 53 | } |
54 | 54 | |
@@ -58,37 +58,37 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | // Early exit if we use "choice" but not for this property. |
61 | - if ( isset( $output['choice'] ) && $output['choice'] !== $property ) { |
|
61 | + if ( isset( $output[ 'choice' ] ) && $output[ 'choice' ] !== $property ) { |
|
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
65 | 65 | // Take care of variants. |
66 | - if ( 'variant' == $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) { |
|
66 | + if ( 'variant' == $property && isset( $value[ 'variant' ] ) && ! empty( $value[ 'variant' ] ) ) { |
|
67 | 67 | |
68 | 68 | // Get the font_weight. |
69 | - $font_weight = str_replace( 'italic', '', $value['variant'] ); |
|
69 | + $font_weight = str_replace( 'italic', '', $value[ 'variant' ] ); |
|
70 | 70 | $font_weight = ( in_array( $font_weight, array( '', 'regular' ) ) ) ? '400' : $font_weight; |
71 | 71 | |
72 | 72 | // Is this italic? |
73 | - $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); |
|
74 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight; |
|
73 | + $is_italic = ( false !== strpos( $value[ 'variant' ], 'italic' ) ); |
|
74 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'font-weight' ] = $font_weight; |
|
75 | 75 | if ( $is_italic ) { |
76 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic'; |
|
76 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'font-style' ] = 'italic'; |
|
77 | 77 | } |
78 | 78 | continue; |
79 | 79 | } |
80 | 80 | |
81 | 81 | $property_value = $this->process_property_value( $property, $value[ $property ] ); |
82 | 82 | if ( 'font-family' === $property ) { |
83 | - $value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : ''; |
|
83 | + $value[ 'font-backup' ] = ( isset( $value[ 'font-backup' ] ) ) ? $value[ 'font-backup' ] : ''; |
|
84 | 84 | $property_value = $this->process_property_value( $property, array( |
85 | - $value['font-family'], |
|
86 | - $value['font-backup'], |
|
85 | + $value[ 'font-family' ], |
|
86 | + $value[ 'font-backup' ], |
|
87 | 87 | ) ); |
88 | 88 | } |
89 | - $property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property; |
|
90 | - $property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value; |
|
91 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix']; |
|
89 | + $property = ( isset( $output[ 'choice' ] ) && isset( $output[ 'property' ] ) ) ? $output[ 'property' ] : $property; |
|
90 | + $property_value = ( is_array( $property_value ) && isset( $property_value[ 0 ] ) ) ? $property_value[ 0 ] : $property_value; |
|
91 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $output[ 'prefix' ] . $property_value . $output[ 'suffix' ]; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |