@@ -9,13 +9,13 @@ |
||
9 | 9 | // Add backup font |
10 | 10 | if ( Kirki_Fonts::is_google_font( $this->value ) ) { |
11 | 11 | |
12 | - if ( isset( $google_fonts_array[ $this->value ] ) && isset( $google_fonts_array[ $this->value ]['category'] ) ) { |
|
13 | - if ( isset( $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ] ) ) { |
|
12 | + if ( isset( $google_fonts_array[$this->value] ) && isset( $google_fonts_array[$this->value]['category'] ) ) { |
|
13 | + if ( isset( $backup_fonts[$google_fonts_array[$this->value]['category']] ) ) { |
|
14 | 14 | // add double quotes if needed |
15 | 15 | if ( false !== strpos( $this->value, ' ' ) && false === strpos( $this->value, '"' ) ) { |
16 | - $this->value = '"' . $this->value . '", ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
16 | + $this->value = '"' . $this->value . '", ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
17 | 17 | } else { |
18 | - $this->value .= ', ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
18 | + $this->value .= ', ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | |
7 | 7 | // Take care of font-families |
8 | 8 | if ( isset( $value['font-family'] ) ) { |
9 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-family'] = $this->process_property_value( 'font-family', $value['font-family'] ); |
|
9 | + $this->styles[$output['media_query']][$output['element']]['font-family'] = $this->process_property_value( 'font-family', $value['font-family'] ); |
|
10 | 10 | } |
11 | 11 | // Add support for the older font-weight parameter. |
12 | 12 | // This has been deprecated so the code below is just |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // and make changes to their typography, |
16 | 16 | // new values are saved and this one is no longer used. |
17 | 17 | if ( isset( $value['font-weight'] ) && $value['font-weight'] ) { |
18 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $value['font-weight']; |
|
18 | + $this->styles[$output['media_query']][$output['element']]['font-weight'] = $value['font-weight']; |
|
19 | 19 | } |
20 | 20 | // Take care of variants |
21 | 21 | if ( isset( $value['variant'] ) && $value['variant'] ) { |
@@ -24,22 +24,22 @@ discard block |
||
24 | 24 | $font_weight = ( in_array( $font_weight, array( '', 'regular' ) ) ) ? '400' : $font_weight; |
25 | 25 | // Is this italic? |
26 | 26 | $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); |
27 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight; |
|
27 | + $this->styles[$output['media_query']][$output['element']]['font-weight'] = $font_weight; |
|
28 | 28 | if ( $is_italic ) { |
29 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic'; |
|
29 | + $this->styles[$output['media_query']][$output['element']]['font-style'] = 'italic'; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | // Take care of font-size |
33 | 33 | if ( isset( $value['font-size'] ) ) { |
34 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-size'] = $value['font-size']; |
|
34 | + $this->styles[$output['media_query']][$output['element']]['font-size'] = $value['font-size']; |
|
35 | 35 | } |
36 | 36 | // Take care of line-height |
37 | 37 | if ( isset( $value['line-height'] ) ) { |
38 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['line-height'] = $value['line-height']; |
|
38 | + $this->styles[$output['media_query']][$output['element']]['line-height'] = $value['line-height']; |
|
39 | 39 | } |
40 | 40 | // Take care of letter-spacing |
41 | 41 | if ( isset( $value['letter-spacing'] ) ) { |
42 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['letter-spacing'] = $value['letter-spacing']; |
|
42 | + $this->styles[$output['media_query']][$output['element']]['letter-spacing'] = $value['letter-spacing']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // escape the element |
58 | 58 | $output['element'] = esc_js( $output['element'] ); |
59 | 59 | |
60 | - $this->output[ $key ]['element'] = $output['element']; |
|
60 | + $this->output[$key]['element'] = $output['element']; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return void |
100 | 100 | */ |
101 | 101 | protected function process_output( $output, $value ) { |
102 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
102 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'background-image' => 'Kirki_Output_Property_Background_Image', |
116 | 116 | ) ); |
117 | 117 | if ( array_key_exists( $property, $properties ) ) { |
118 | - $classname = $properties[ $property ]; |
|
118 | + $classname = $properties[$property]; |
|
119 | 119 | $obj = new $classname( $property, $value ); |
120 | 120 | return $obj->get_value(); |
121 | 121 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'typography' => 'Kirki_Output_Control_Typography', |
97 | 97 | ) ); |
98 | 98 | if ( array_key_exists( self::$field_type, $field_output_classes ) ) { |
99 | - $classname = $field_output_classes[ self::$field_type ]; |
|
99 | + $classname = $field_output_classes[self::$field_type]; |
|
100 | 100 | } |
101 | 101 | $obj = new $classname( $field['kirki_config'], self::$output, self::$value ); |
102 | 102 | return $obj->get_styles(); |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | 'transition', |
173 | 173 | 'transition-property', |
174 | 174 | ) ) ) { |
175 | - $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; |
|
176 | - $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; |
|
175 | + $css[$media_query][$element]['-webkit-' . $property] = $value; |
|
176 | + $css[$media_query][$element]['-moz-' . $property] = $value; |
|
177 | 177 | } |
178 | 178 | /** |
179 | 179 | * Add -ms-* and -o-* |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | 'transition', |
185 | 185 | 'transition-property', |
186 | 186 | ) ) ) { |
187 | - $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; |
|
188 | - $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; |
|
187 | + $css[$media_query][$element]['-ms-' . $property] = $value; |
|
188 | + $css[$media_query][$element]['-o-' . $property] = $value; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | // Add the requested google-font |
100 | - if ( ! isset( $this->fonts[ $value['font-family'] ] ) ) { |
|
101 | - $this->fonts[ $value['font-family'] ] = array(); |
|
100 | + if ( ! isset( $this->fonts[$value['font-family']] ) ) { |
|
101 | + $this->fonts[$value['font-family']] = array(); |
|
102 | 102 | } |
103 | - if ( ! in_array( $value['variant'], $this->fonts[ $value['font-family'] ] ) ) { |
|
104 | - $this->fonts[ $value['font-family'] ][] = $value['variant']; |
|
103 | + if ( ! in_array( $value['variant'], $this->fonts[$value['font-family']] ) ) { |
|
104 | + $this->fonts[$value['font-family']][] = $value['variant']; |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if ( isset( $args['output'] ) && is_array( $args['output'] ) ) { |
113 | 113 | foreach ( $args['output'] as $output ) { |
114 | 114 | // If we don't have a typography-related output argument we can skip this. |
115 | - if ( ! isset( $output['property'] ) || ! in_array( $output['property'], array( 'font-family', 'font-weight', 'font-subset', 'subset' ) ) ) { |
|
115 | + if ( ! isset( $output['property'] ) || ! in_array( $output['property'], array( 'font-family', 'font-weight', 'font-subset', 'subset' ) ) ) { |
|
116 | 116 | continue; |
117 | 117 | } |
118 | 118 | // Get the value |
@@ -121,14 +121,14 @@ discard block |
||
121 | 121 | // font-family |
122 | 122 | if ( 'font-family' == $output['property'] ) { |
123 | 123 | if ( ! array_key_exists( $value, $this->fonts ) ) { |
124 | - $this->fonts[ $value ] = array(); |
|
124 | + $this->fonts[$value] = array(); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | // font-weight |
128 | 128 | elseif ( 'font-weight' == $output['property'] ) { |
129 | 129 | foreach ( $this->fonts as $font => $variants ) { |
130 | 130 | if ( ! in_array( $value, $variants ) ) { |
131 | - $this->fonts[ $font ][] = $value; |
|
131 | + $this->fonts[$font][] = $value; |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -165,27 +165,27 @@ discard block |
||
165 | 165 | // Determine if this is indeed a google font or not. |
166 | 166 | // If it's not, then just remove it from the array. |
167 | 167 | if ( ! array_key_exists( $font, $google_fonts ) ) { |
168 | - unset( $this->fonts[ $font ] ); |
|
168 | + unset( $this->fonts[$font] ); |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | // Get all valid font variants for this font |
172 | 172 | $font_variants = array(); |
173 | - if ( isset( $google_fonts[ $font ]['variants'] ) ) { |
|
174 | - $font_variants = $google_fonts[ $font ]['variants']; |
|
173 | + if ( isset( $google_fonts[$font]['variants'] ) ) { |
|
174 | + $font_variants = $google_fonts[$font]['variants']; |
|
175 | 175 | } |
176 | 176 | foreach ( $variants as $variant ) { |
177 | 177 | // If this is not a valid variant for this font-family |
178 | 178 | // then unset it and move on to the next one. |
179 | 179 | if ( ! in_array( $variant, $font_variants ) ) { |
180 | - unset( $this->fonts[ $font ][ $variant ] ); |
|
180 | + unset( $this->fonts[$font][$variant] ); |
|
181 | 181 | continue; |
182 | 182 | } |
183 | 183 | } |
184 | 184 | // Check if the selected subsets exist, even in one of the selected fonts. |
185 | 185 | // If they don't, then they have to be removed otherwise the link will fail. |
186 | - if ( isset( $google_fonts[ $font ]['subsets'] ) ) { |
|
186 | + if ( isset( $google_fonts[$font]['subsets'] ) ) { |
|
187 | 187 | foreach ( $this->subsets as $subset ) { |
188 | - if ( in_array( $subset, $google_fonts[ $font ]['subsets'] ) ) { |
|
188 | + if ( in_array( $subset, $google_fonts[$font]['subsets'] ) ) { |
|
189 | 189 | $valid_subsets[] = $subset; |
190 | 190 | } |
191 | 191 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | } else { |
11 | 11 | $property = $output['property'] . '-' . $key; |
12 | 12 | } |
13 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value; |
|
13 | + $this->styles[$output['media_query']][$output['element']][$property] = $sub_value; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | } |