Completed
Push — develop ( 1b6970...37e01c )
by Aristeides
02:52
created
modules/css/class-kirki-output.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 			'background-image',
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.