Completed
Branch develop (1becb4)
by Aristeides
05:50 queued 02:46
created
includes/class-kirki-field.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 			// Get defaults from the class
181 181
 			$defaults = get_class_vars( __CLASS__ );
182 182
 			// Get the config arguments, and merge them with the defaults
183
-			$config_defaults = Kirki::$config[ $this->kirki_config ];
183
+			$config_defaults = Kirki::$config[$this->kirki_config];
184 184
 			foreach ( $config_defaults as $key => $value ) {
185
-				if ( isset( $defaults[ $key ] ) ) {
186
-					if ( ! empty( $value ) && $value != $defaults[ $key ] ) {
187
-						$defaults[ $key ] = $value;
185
+				if ( isset( $defaults[$key] ) ) {
186
+					if ( ! empty( $value ) && $value != $defaults[$key] ) {
187
+						$defaults[$key] = $value;
188 188
 					}
189 189
 				}
190 190
 			}
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 			// remove any whitelisted properties from above
215 215
 			// These will get a free pass, completely unfiltered.
216 216
 			foreach ( $whitelisted_properties as $key => $default_value ) {
217
-				if ( isset( $properties[ $key ] ) ) {
218
-					unset( $properties[ $key ] );
217
+				if ( isset( $properties[$key] ) ) {
218
+					unset( $properties[$key] );
219 219
 				}
220 220
 			}
221 221
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 			// Get all arguments with their values
248 248
 			$args = get_class_vars( __CLASS__ );
249 249
 			foreach ( $args as $key => $default_value ) {
250
-				$args[ $key ] = $this->$key;
250
+				$args[$key] = $this->$key;
251 251
 			}
252 252
 
253 253
 			// add the whitelisted properties through the back door
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
 				if ( ! isset( $this->$key ) ) {
256 256
 					$this->$key = $default_value;
257 257
 				}
258
-				$args[ $key ] = $this->$key;
258
+				$args[$key] = $this->$key;
259 259
 			}
260 260
 
261 261
 			// Add the field to the static $fields variable properly indexed
262
-			Kirki::$fields[ $this->settings ] = $args;
262
+			Kirki::$fields[$this->settings] = $args;
263 263
 
264 264
 			if ( 'background' == $this->type ) {
265 265
 				// Build the background fields
@@ -356,10 +356,10 @@  discard block
 block discarded – undo
356 356
 			}
357 357
 			$settings = array();
358 358
 			foreach ( $this->settings as $setting_key => $setting_value ) {
359
-				$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
359
+				$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
360 360
 				// If we're using serialized options then we need to spice this up
361 361
 				if ( 'option' == $this->option_type && '' != $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
362
-					$settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ).']';
362
+					$settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']';
363 363
 				}
364 364
 			}
365 365
 			$this->settings = $settings;
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 			);
543 543
 
544 544
 			if ( array_key_exists( $this->type, $default_callbacks ) ) {
545
-				$this->sanitize_callback = $default_callbacks[ $this->type ];
545
+				$this->sanitize_callback = $default_callbacks[$this->type];
546 546
 			}
547 547
 
548 548
 		}
Please login to merge, or discard this patch.
includes/class-kirki-explode-background-field.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 				$key               = esc_attr( $key );
37 37
 				$setting           = $key;
38 38
 				$tooltip           = $field['tooltip'];
39
-				$description       = isset( $i18n[ 'background-' . $key ] ) ? $i18n[ 'background-' . $key ] : '';
39
+				$description       = isset( $i18n['background-' . $key] ) ? $i18n['background-' . $key] : '';
40 40
 				$output_property   = 'background-' . $key;
41 41
 				$label             = ( 0 === $i ) ? $field['label'] : '';
42 42
 				$type              = 'select';
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				 * Build the field.
92 92
 				 * We're merging with the original field here, so any extra properties are inherited.
93 93
 				 */
94
-				$fields[ $property_setting ] = array_merge( $field, array(
94
+				$fields[$property_setting] = array_merge( $field, array(
95 95
 					'type'              => $type,
96 96
 					'label'             => $label,
97 97
 					'settings'          => $property_setting,
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 					'description'       => $description,
103 103
 					'default'           => $value,
104 104
 					'id'                => sanitize_key( str_replace( '[', '-', str_replace( ']', '', $property_setting ) ) ),
105
-					'choices'           => isset( $choices[ $key ] ) ? $choices[ $key ] : array(),
105
+					'choices'           => isset( $choices[$key] ) ? $choices[$key] : array(),
106 106
 					'sanitize_callback' => $sanitize_callback,
107 107
 					'output'            => ( ! empty( $field['output'] ) ) ? array(
108 108
 						array(
Please login to merge, or discard this patch.
includes/output/class-kirki-output.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 			return;
108 108
 		}
109 109
 		$output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global';
110
-		$output['prefix']      = ( isset( $output['prefix'] ) )      ? $output['prefix']      : '';
111
-		$output['units']       = ( isset( $output['units'] ) )       ? $output['units']       : '';
112
-		$output['suffix']      = ( isset( $output['suffix'] ) )      ? $output['suffix']      : '';
110
+		$output['prefix']      = ( isset( $output['prefix'] ) ) ? $output['prefix'] : '';
111
+		$output['units']       = ( isset( $output['units'] ) ) ? $output['units'] : '';
112
+		$output['suffix']      = ( isset( $output['suffix'] ) ) ? $output['suffix'] : '';
113 113
 
114 114
 		if ( is_array( $output['element'] ) ) {
115 115
 			$output['element'] = array_unique( $output['element'] );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			$output['element'] = implode( ',', $output['element'] );
118 118
 		}
119 119
 
120
-		$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
120
+		$this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
121 121
 	}
122 122
 
123 123
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			'background-position' => 'Kirki_Output_Property_Background_Position',
138 138
 		) );
139 139
 		if ( array_key_exists( $property, $properties ) ) {
140
-			$classname = $properties[ $property ];
140
+			$classname = $properties[$property];
141 141
 			$obj = new $classname( $property, $value );
142 142
 			return $obj->get_value();
143 143
 		}
Please login to merge, or discard this patch.