@@ -179,7 +179,7 @@ |
||
179 | 179 | case 'letter-spacing': |
180 | 180 | case 'word-spacing': |
181 | 181 | case 'line-height': |
182 | - $value[ $key ] = Kirki_Sanitize_Values::css_dimension( $val ); |
|
182 | + $value[$key] = Kirki_Sanitize_Values::css_dimension( $val ); |
|
183 | 183 | break; |
184 | 184 | case 'text-align': |
185 | 185 | if ( ! in_array( $val, array( 'inherit', 'left', 'center', 'right', 'justify' ), true ) ) { |
@@ -38,14 +38,14 @@ |
||
38 | 38 | |
39 | 39 | $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
40 | 40 | |
41 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = $value['start']['color']; |
|
41 | + $this->styles[$output['media_query']][$output['element']]['background'] = $value['start']['color']; |
|
42 | 42 | switch ( $value['mode'] ) { |
43 | 43 | |
44 | 44 | case 'linear': |
45 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = 'linear-gradient(' . intval( $value['angle'] ) . 'deg, ' . $value['start']['color'] . ' ' . $value['start']['position'] . '%,' . $value['end']['color'] . ' ' . $value['end']['position'] . '%)'; |
|
45 | + $this->styles[$output['media_query']][$output['element']]['background'] = 'linear-gradient(' . intval( $value['angle'] ) . 'deg, ' . $value['start']['color'] . ' ' . $value['start']['position'] . '%,' . $value['end']['color'] . ' ' . $value['end']['position'] . '%)'; |
|
46 | 46 | break; |
47 | 47 | case 'radial': |
48 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = 'radial-gradient(ellipse at center,' . $value['start']['color'] . ' ' . $value['start']['position'] . '%,' . $value['end']['color'] . ' ' . $value['end']['position'] . '%)'; |
|
48 | + $this->styles[$output['media_query']][$output['element']]['background'] = 'radial-gradient(ellipse at center,' . $value['start']['color'] . ' ' . $value['start']['position'] . '%,' . $value['end']['color'] . ' ' . $value['end']['position'] . '%)'; |
|
49 | 49 | break; |
50 | 50 | } |
51 | 51 | } |
@@ -67,9 +67,9 @@ |
||
67 | 67 | |
68 | 68 | // Make sure that every row is an array, not an object. |
69 | 69 | foreach ( $sanitized as $key => $_value ) { |
70 | - $sanitized[ $key ] = (array) $_value; |
|
70 | + $sanitized[$key] = (array) $_value; |
|
71 | 71 | if ( empty( $_value ) ) { |
72 | - unset( $sanitized[ $key ] ); |
|
72 | + unset( $sanitized[$key] ); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 |
@@ -130,8 +130,8 @@ |
||
130 | 130 | // Are we force-loading all subsets? |
131 | 131 | if ( true === Kirki_Fonts_Google::$force_load_all_subsets ) { |
132 | 132 | |
133 | - if ( isset( $this->googlefonts[ $font ]['subsets'] ) ) { |
|
134 | - foreach ( $this->googlefonts[ $font ]['subsets'] as $subset ) { |
|
133 | + if ( isset( $this->googlefonts[$font]['subsets'] ) ) { |
|
134 | + foreach ( $this->googlefonts[$font]['subsets'] as $subset ) { |
|
135 | 135 | $this->subsets[] = $subset; |
136 | 136 | } |
137 | 137 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->control_types = $this->default_control_types( apply_filters( 'kirki/control_types', $this->control_types ) ); |
168 | 168 | foreach ( $this->control_types as $key => $classname ) { |
169 | 169 | if ( ! class_exists( $classname ) ) { |
170 | - unset( $this->control_types[ $key ] ); |
|
170 | + unset( $this->control_types[$key] ); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | foreach ( Kirki::$panels as $panel_args ) { |
194 | 194 | // Extra checks for nested panels. |
195 | 195 | if ( isset( $panel_args['panel'] ) ) { |
196 | - if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) { |
|
196 | + if ( isset( Kirki::$panels[$panel_args['panel']] ) ) { |
|
197 | 197 | // Set the type to nested. |
198 | 198 | $panel_args['type'] = 'kirki-nested'; |
199 | 199 | } |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | foreach ( Kirki::$sections as $section_args ) { |
216 | 216 | // Extra checks for nested sections. |
217 | 217 | if ( isset( $section_args['section'] ) ) { |
218 | - if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) { |
|
218 | + if ( isset( Kirki::$sections[$section_args['section']] ) ) { |
|
219 | 219 | // Set the type to nested. |
220 | 220 | $section_args['type'] = 'kirki-nested'; |
221 | 221 | // We need to check if the parent section is nested inside a panel. |
222 | - $parent_section = Kirki::$sections[ $section_args['section'] ]; |
|
222 | + $parent_section = Kirki::$sections[$section_args['section']]; |
|
223 | 223 | if ( isset( $parent_section['panel'] ) ) { |
224 | 224 | $section_args['panel'] = $parent_section['panel']; |
225 | 225 | } |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | $value = str_replace( '$', $value, $output['value_pattern'] ); |
102 | 102 | } |
103 | 103 | if ( is_array( $value ) ) { |
104 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) ) { |
|
105 | - $value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] ); |
|
104 | + if ( isset( $output['choice'] ) && isset( $value[$output['choice']] ) ) { |
|
105 | + $value[$output['choice']] = str_replace( '$', $value[$output['choice']], $output['value_pattern'] ); |
|
106 | 106 | } else { |
107 | 107 | foreach ( array_keys( $value ) as $value_k ) { |
108 | - if ( is_string( $value[ $value_k ] ) ) { |
|
109 | - $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] ); |
|
108 | + if ( is_string( $value[$value_k] ) ) { |
|
109 | + $value[$value_k] = str_replace( '$', $value[$value_k], $output['value_pattern'] ); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) { |
115 | 115 | $option_type = 'theme_mod'; |
116 | 116 | $option_name = false; |
117 | - if ( isset( Kirki::$config[ $this->config_id ] ) ) { |
|
118 | - $config = Kirki::$config[ $this->config_id ]; |
|
117 | + if ( isset( Kirki::$config[$this->config_id] ) ) { |
|
118 | + $config = Kirki::$config[$this->config_id]; |
|
119 | 119 | $option_type = ( isset( $config['option_type'] ) ) ? $config['option_type'] : 'theme_mod'; |
120 | 120 | if ( 'option' === $option_type || 'site_option' === $option_type ) { |
121 | 121 | $option_name = ( isset( $config['option_name'] ) ) ? $config['option_name'] : false; |
@@ -132,16 +132,16 @@ discard block |
||
132 | 132 | if ( is_array( $options ) ) { |
133 | 133 | if ( $option_name ) { |
134 | 134 | $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace ); |
135 | - $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; |
|
135 | + $replacement = ( isset( $options[$subkey] ) ) ? $options[$subkey] : ''; |
|
136 | 136 | break; |
137 | 137 | } |
138 | - $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; |
|
138 | + $replacement = ( isset( $options[$replace] ) ) ? $options[$replace] : ''; |
|
139 | 139 | break; |
140 | 140 | } |
141 | 141 | $replacement = get_option( $replace ); |
142 | 142 | break; |
143 | 143 | case 'site_option': |
144 | - $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); |
|
144 | + $replacement = ( is_array( $options ) && isset( $options[$replace] ) ) ? $options[$replace] : get_site_option( $replace ); |
|
145 | 145 | break; |
146 | 146 | case 'user_meta': |
147 | 147 | $user_id = get_current_user_id(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $replacement = ( false === $replacement ) ? '' : $replacement; |
157 | 157 | if ( is_array( $value ) ) { |
158 | 158 | foreach ( $value as $k => $v ) { |
159 | - $value[ $k ] = str_replace( $search, $replacement, $value[ $v ] ); |
|
159 | + $value[$k] = str_replace( $search, $replacement, $value[$v] ); |
|
160 | 160 | } |
161 | 161 | return $value; |
162 | 162 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | // If 'choice' is defined check for sub-values too. |
203 | 203 | // Fixes https://github.com/aristath/kirki/issues/1416. |
204 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { |
|
204 | + if ( isset( $output['choice'] ) && isset( $value[$output['choice']] ) && $exclude == $value[$output['choice']] ) { |
|
205 | 205 | $skip = true; |
206 | 206 | } |
207 | 207 | } |
@@ -259,13 +259,13 @@ discard block |
||
259 | 259 | 'background', |
260 | 260 | ); |
261 | 261 | if ( in_array( $output['property'], $accepts_multiple, true ) ) { |
262 | - if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { |
|
263 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; |
|
262 | + if ( isset( $this->styles[$output['media_query']][$output['element']][$output['property']] ) && ! is_array( $this->styles[$output['media_query']][$output['element']][$output['property']] ) ) { |
|
263 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = (array) $this->styles[$output['media_query']][$output['element']][$output['property']]; |
|
264 | 264 | } |
265 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
265 | + $this->styles[$output['media_query']][$output['element']][$output['property']][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
266 | 266 | return; |
267 | 267 | } |
268 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
268 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | 'background-position' => 'Kirki_Output_Property_Background_Position', |
286 | 286 | ) ); |
287 | 287 | if ( array_key_exists( $property, $properties ) ) { |
288 | - $classname = $properties[ $property ]; |
|
288 | + $classname = $properties[$property]; |
|
289 | 289 | $obj = new $classname( $property, $value ); |
290 | 290 | return $obj->get_value(); |
291 | 291 | } |