@@ -102,16 +102,16 @@ discard block |
||
102 | 102 | } |
103 | 103 | if ( is_array( $value ) ) { |
104 | 104 | foreach ( array_keys( $value ) as $value_k ) { |
105 | - if ( ! is_string( $value[ $value_k ] ) ) { |
|
105 | + if ( ! is_string( $value[$value_k] ) ) { |
|
106 | 106 | continue; |
107 | 107 | } |
108 | 108 | if ( isset( $output['choice'] ) ) { |
109 | 109 | if ( $output['choice'] === $value_k ) { |
110 | - $value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] ); |
|
110 | + $value[$output['choice']] = str_replace( '$', $value[$output['choice']], $output['value_pattern'] ); |
|
111 | 111 | } |
112 | 112 | continue; |
113 | 113 | } |
114 | - $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] ); |
|
114 | + $value[$value_k] = str_replace( '$', $value[$value_k], $output['value_pattern'] ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) { |
@@ -128,16 +128,16 @@ discard block |
||
128 | 128 | if ( is_array( $options ) ) { |
129 | 129 | if ( $option_name ) { |
130 | 130 | $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace ); |
131 | - $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; |
|
131 | + $replacement = ( isset( $options[$subkey] ) ) ? $options[$subkey] : ''; |
|
132 | 132 | break; |
133 | 133 | } |
134 | - $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; |
|
134 | + $replacement = ( isset( $options[$replace] ) ) ? $options[$replace] : ''; |
|
135 | 135 | break; |
136 | 136 | } |
137 | 137 | $replacement = get_option( $replace ); |
138 | 138 | break; |
139 | 139 | case 'site_option': |
140 | - $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); |
|
140 | + $replacement = ( is_array( $options ) && isset( $options[$replace] ) ) ? $options[$replace] : get_site_option( $replace ); |
|
141 | 141 | break; |
142 | 142 | case 'user_meta': |
143 | 143 | $user_id = get_current_user_id(); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $replacement = ( false === $replacement ) ? '' : $replacement; |
153 | 153 | if ( is_array( $value ) ) { |
154 | 154 | foreach ( $value as $k => $v ) { |
155 | - $value[ $k ] = str_replace( $search, $replacement, $value[ $v ] ); |
|
155 | + $value[$k] = str_replace( $search, $replacement, $value[$v] ); |
|
156 | 156 | } |
157 | 157 | return $value; |
158 | 158 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | // If 'choice' is defined check for sub-values too. |
199 | 199 | // Fixes https://github.com/aristath/kirki/issues/1416. |
200 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { |
|
200 | + if ( isset( $output['choice'] ) && isset( $value[$output['choice']] ) && $exclude == $value[$output['choice']] ) { |
|
201 | 201 | $skip = true; |
202 | 202 | } |
203 | 203 | } |
@@ -255,13 +255,13 @@ discard block |
||
255 | 255 | 'background', |
256 | 256 | ); |
257 | 257 | if ( in_array( $output['property'], $accepts_multiple, true ) ) { |
258 | - if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { |
|
259 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; |
|
258 | + if ( isset( $this->styles[$output['media_query']][$output['element']][$output['property']] ) && ! is_array( $this->styles[$output['media_query']][$output['element']][$output['property']] ) ) { |
|
259 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = (array) $this->styles[$output['media_query']][$output['element']][$output['property']]; |
|
260 | 260 | } |
261 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
261 | + $this->styles[$output['media_query']][$output['element']][$output['property']][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
262 | 262 | return; |
263 | 263 | } |
264 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
264 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | 'background-position' => 'Kirki_Output_Property_Background_Position', |
282 | 282 | ) ); |
283 | 283 | if ( array_key_exists( $property, $properties ) ) { |
284 | - $classname = $properties[ $property ]; |
|
284 | + $classname = $properties[$property]; |
|
285 | 285 | $obj = new $classname( $property, $value ); |
286 | 286 | return $obj->get_value(); |
287 | 287 | } |