@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | } |
102 | 102 | if ( is_array( $value ) ) { |
103 | 103 | foreach ( array_keys( $value ) as $value_k ) { |
104 | - if ( ! is_string( $value[ $value_k ] ) ) { |
|
104 | + if ( ! is_string( $value[$value_k] ) ) { |
|
105 | 105 | continue; |
106 | 106 | } |
107 | 107 | if ( isset( $output['choice'] ) ) { |
108 | 108 | if ( $output['choice'] === $value_k ) { |
109 | - $value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] ); |
|
109 | + $value[$output['choice']] = str_replace( '$', $value[$output['choice']], $output['value_pattern'] ); |
|
110 | 110 | } |
111 | 111 | continue; |
112 | 112 | } |
113 | - $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] ); |
|
113 | + $value[$value_k] = str_replace( '$', $value[$value_k], $output['value_pattern'] ); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | $value = $this->apply_pattern_replace( $output, $value ); |
@@ -140,16 +140,16 @@ discard block |
||
140 | 140 | if ( is_array( $options ) ) { |
141 | 141 | if ( $option_name ) { |
142 | 142 | $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace ); |
143 | - $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; |
|
143 | + $replacement = ( isset( $options[$subkey] ) ) ? $options[$subkey] : ''; |
|
144 | 144 | break; |
145 | 145 | } |
146 | - $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; |
|
146 | + $replacement = ( isset( $options[$replace] ) ) ? $options[$replace] : ''; |
|
147 | 147 | break; |
148 | 148 | } |
149 | 149 | $replacement = get_option( $replace ); |
150 | 150 | break; |
151 | 151 | case 'site_option': |
152 | - $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); |
|
152 | + $replacement = ( is_array( $options ) && isset( $options[$replace] ) ) ? $options[$replace] : get_site_option( $replace ); |
|
153 | 153 | break; |
154 | 154 | case 'user_meta': |
155 | 155 | $user_id = get_current_user_id(); |
@@ -166,11 +166,11 @@ discard block |
||
166 | 166 | foreach ( $value as $k => $v ) { |
167 | 167 | if ( isset( $output['choice'] ) ) { |
168 | 168 | if ( $k === $output['choice'] ) { |
169 | - $value[ $k ] = str_replace( $search, $replacement, $v ); |
|
169 | + $value[$k] = str_replace( $search, $replacement, $v ); |
|
170 | 170 | } |
171 | 171 | continue; |
172 | 172 | } |
173 | - $value[ $k ] = str_replace( $search, $replacement, $v ); |
|
173 | + $value[$k] = str_replace( $search, $replacement, $v ); |
|
174 | 174 | } |
175 | 175 | return $value; |
176 | 176 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | // If 'choice' is defined check for sub-values too. |
214 | 214 | // Fixes https://github.com/aristath/kirki/issues/1416. |
215 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { |
|
215 | + if ( isset( $output['choice'] ) && isset( $value[$output['choice']] ) && $exclude == $value[$output['choice']] ) { |
|
216 | 216 | $skip = true; |
217 | 217 | } |
218 | 218 | } |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | 'background', |
271 | 271 | ); |
272 | 272 | if ( in_array( $output['property'], $accepts_multiple, true ) ) { |
273 | - if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { |
|
274 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; |
|
273 | + if ( isset( $this->styles[$output['media_query']][$output['element']][$output['property']] ) && ! is_array( $this->styles[$output['media_query']][$output['element']][$output['property']] ) ) { |
|
274 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = (array) $this->styles[$output['media_query']][$output['element']][$output['property']]; |
|
275 | 275 | } |
276 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
276 | + $this->styles[$output['media_query']][$output['element']][$output['property']][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
277 | 277 | return; |
278 | 278 | } |
279 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; |
|
279 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | 'background-position' => 'Kirki_Output_Property_Background_Position', |
297 | 297 | ) ); |
298 | 298 | if ( array_key_exists( $property, $properties ) ) { |
299 | - $classname = $properties[ $property ]; |
|
299 | + $classname = $properties[$property]; |
|
300 | 300 | $obj = new $classname( $property, $value ); |
301 | 301 | return $obj->get_value(); |
302 | 302 | } |