Completed
Pull Request — develop (#1334)
by Aristeides
02:48
created
modules/postmessage/class-kirki-modules-postmessage.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 			$js_var['index_key'] = $key;
81 81
 			$callback = $this->get_callback( $args );
82 82
 			if ( is_callable( $callback ) ) {
83
-				$field['scripts'][ $key ] = call_user_func_array( $callback, array( $js_var, $args ) );
83
+				$field['scripts'][$key] = call_user_func_array( $callback, array( $js_var, $args ) );
84 84
 				continue;
85 85
 			}
86
-			$field['scripts'][ $key ] = $this->script_var( $js_var, $args );
86
+			$field['scripts'][$key] = $this->script_var( $js_var, $args );
87 87
 		}
88 88
 		$combo_extra_script = '';
89 89
 		$combo_css_script   = '';
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 		}
187 187
 
188 188
 		// Mostly used for padding, margin & position properties.
189
-		$direction_script  ='if(_.contains([\'top\',\'bottom\',\'left\',\'right\'],subKey)){';
190
-		$direction_script .='css+=\'' . $args['element'] . '{' . $args['property'] . '-\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';}';
189
+		$direction_script  = 'if(_.contains([\'top\',\'bottom\',\'left\',\'right\'],subKey)){';
190
+		$direction_script .= 'css+=\'' . $args['element'] . '{' . $args['property'] . '-\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';}';
191 191
 		// Allows us to apply this just for a specific choice in the array of the values.
192 192
 		if ( '' !== $choice ) {
193 193
 			$choice_is_direction = ( false !== strpos( $choice, 'top' ) || false !== strpos( $choice, 'bottom' ) || false !== strpos( $choice, 'left' ) || false !== strpos( $choice, 'right' ) );
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			$script .= ( $choice_is_direction ) ? '}' : '';
199 199
 			$script .= '}';
200 200
 		} else {
201
-			$script .= $direction_script .'else{';
201
+			$script .= $direction_script . 'else{';
202 202
 
203 203
 			// This is where most object-based fields will go.
204 204
 			$script .= 'css+=\'' . $args['element'] . '{\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';';
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			'font-weight'    => 'fontWeight',
242 242
 			'font-style'     => 'fontStyle',
243 243
 		);
244
-		$choice_condition = ( isset( $args['choice'] ) && '' !== $args['choice'] && isset( $css_build_array[ $args['choice'] ] ) );
244
+		$choice_condition = ( isset( $args['choice'] ) && '' !== $args['choice'] && isset( $css_build_array[$args['choice']] ) );
245 245
 		$script .= ( ! $choice_condition ) ? $webfont_loader : '';
246 246
 		foreach ( $css_build_array as $property => $var ) {
247 247
 			if ( $choice_condition && $property !== $args['choice'] ) {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 			'units'         => '',
313 313
 			'js_callback'   => array( '', '' ),
314 314
 			'value_pattern' => '',
315
-		));
315
+		) );
316 316
 
317 317
 		// Element should be a string.
318 318
 		if ( is_array( $args['element'] ) ) {
Please login to merge, or discard this patch.