@@ -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 | } |
@@ -101,19 +101,19 @@ 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 ( $value as $k => $v ) { |
108 | - $value[ $k ] = str_replace( '$', $value[ $k ], $output['value_pattern'] ); |
|
108 | + $value[$k] = str_replace( '$', $value[$k], $output['value_pattern'] ); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | 112 | if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) { |
113 | 113 | $option_type = 'theme_mod'; |
114 | 114 | $option_name = false; |
115 | - if ( isset( Kirki::$config[ $this->config_id ] ) ) { |
|
116 | - $config = Kirki::$config[ $this->config_id ]; |
|
115 | + if ( isset( Kirki::$config[$this->config_id] ) ) { |
|
116 | + $config = Kirki::$config[$this->config_id]; |
|
117 | 117 | $option_type = ( isset( $config['option_type'] ) ) ? $config['option_type'] : 'theme_mod'; |
118 | 118 | if ( 'option' === $option_type || 'site_option' === $option_type ) { |
119 | 119 | $option_name = ( isset( $config['option_name'] ) ) ? $config['option_name'] : false; |
@@ -129,16 +129,16 @@ discard block |
||
129 | 129 | if ( is_array( $options ) ) { |
130 | 130 | if ( $option_name ) { |
131 | 131 | $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace ); |
132 | - $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; |
|
132 | + $replacement = ( isset( $options[$subkey] ) ) ? $options[$subkey] : ''; |
|
133 | 133 | break; |
134 | 134 | } |
135 | - $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; |
|
135 | + $replacement = ( isset( $options[$replace] ) ) ? $options[$replace] : ''; |
|
136 | 136 | break; |
137 | 137 | } |
138 | 138 | $replacement = get_option( $replace ); |
139 | 139 | break; |
140 | 140 | case 'site_option': |
141 | - $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); |
|
141 | + $replacement = ( is_array( $options ) && isset( $options[$replace] ) ) ? $options[$replace] : get_site_option( $replace ); |
|
142 | 142 | break; |
143 | 143 | case 'user_meta': |
144 | 144 | $user_id = get_current_user_id(); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $replacement = ( false === $replacement ) ? '' : $replacement; |
154 | 154 | if ( is_array( $value ) ) { |
155 | 155 | foreach ( $value as $k => $v ) { |
156 | - $value[ $k ] = str_replace( $search, $replacement, $value[ $v ] ); |
|
156 | + $value[$k] = str_replace( $search, $replacement, $value[$v] ); |
|
157 | 157 | } |
158 | 158 | return $value; |
159 | 159 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | // If 'choice' is defined check for sub-values too. |
200 | 200 | // Fixes https://github.com/aristath/kirki/issues/1416. |
201 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { |
|
201 | + if ( isset( $output['choice'] ) && isset( $value[$output['choice']] ) && $exclude == $value[$output['choice']] ) { |
|
202 | 202 | $skip = true; |
203 | 203 | } |
204 | 204 | } |
@@ -244,9 +244,9 @@ discard block |
||
244 | 244 | return; |
245 | 245 | } |
246 | 246 | $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
247 | - $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; |
|
248 | - $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : ''; |
|
249 | - $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
247 | + $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; |
|
248 | + $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : ''; |
|
249 | + $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
250 | 250 | |
251 | 251 | // Properties that can accept multiple values. |
252 | 252 | // Useful for example for gradients where all browsers use the "background-image" property |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | 'background', |
257 | 257 | ); |
258 | 258 | if ( in_array( $output['property'], $accepts_multiple, true ) ) { |
259 | - if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { |
|
260 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; |
|
259 | + if ( isset( $this->styles[$output['media_query']][$output['element']][$output['property']] ) && ! is_array( $this->styles[$output['media_query']][$output['element']][$output['property']] ) ) { |
|
260 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = (array) $this->styles[$output['media_query']][$output['element']][$output['property']]; |
|
261 | 261 | } |
262 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
262 | + $this->styles[$output['media_query']][$output['element']][$output['property']][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
263 | 263 | return; |
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 | } |
267 | 267 | |
268 | 268 | /** |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | 'background-position' => 'Kirki_Output_Property_Background_Position', |
283 | 283 | ) ); |
284 | 284 | if ( array_key_exists( $property, $properties ) ) { |
285 | - $classname = $properties[ $property ]; |
|
285 | + $classname = $properties[$property]; |
|
286 | 286 | $obj = new $classname( $property, $value ); |
287 | 287 | return $obj->get_value(); |
288 | 288 | } |