Completed
Branch master (3e1132)
by Aristeides
03:12
created
includes/lib/class-kirki-color.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 			// Check if the color is a standard word-color.
186 186
 			// If it is, then convert to hex.
187 187
 			if ( array_key_exists( $color, $word_colors ) ) {
188
-				$color = $word_colors[ $color ];
188
+				$color = $word_colors[$color];
189 189
 			}
190 190
 			// Remove any trailing '#' symbols from the color value
191 191
 			$color = str_replace( '#', '', $color );
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 			}
196 196
 			$substr = array();
197 197
 			for ( $i = 0; $i <= 5; $i++ ) {
198
-				$default    = ( 0 == $i ) ? 'F' : ( $substr[$i-1] );
198
+				$default    = ( 0 == $i ) ? 'F' : ( $substr[$i - 1] );
199 199
 				$substr[$i] = substr( $color, $i, 1 );
200 200
 				$substr[$i] = ( false === $substr[$i] || ! ctype_xdigit( $substr[$i] ) ) ? $default : $substr[$i];
201 201
 			}
Please login to merge, or discard this patch.
includes/class-kirki-toolkit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 				'left'                  => esc_attr__( 'Left', 'kirki' ),
103 103
 				'right'                 => esc_attr__( 'Right', 'kirki' ),
104 104
 				'color'                 => esc_attr__( 'Color', 'kirki' ),
105
-				'add-image'             => esc_attr__( 'Add Image' , 'kirki' ),
106
-				'change-image'          => esc_attr__( 'Change Image' , 'kirki' ),
107
-				'remove'                => esc_attr__( 'Remove' , 'kirki' ),
105
+				'add-image'             => esc_attr__( 'Add Image', 'kirki' ),
106
+				'change-image'          => esc_attr__( 'Change Image', 'kirki' ),
107
+				'remove'                => esc_attr__( 'Remove', 'kirki' ),
108 108
 				'no-image-selected'     => esc_attr__( 'No Image Selected', 'kirki' ),
109 109
 			);
110 110
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		 */
147 147
 		public static function clean_file_path( $path ) {
148 148
 			$path = str_replace( '', '', str_replace( array( "\\", "\\\\" ), '/', $path ) );
149
-			if ( '/' === $path[ strlen( $path ) - 1 ] ) {
149
+			if ( '/' === $path[strlen( $path ) - 1] ) {
150 150
 				$path = rtrim( $path, '/' );
151 151
 			}
152 152
 			return $path;
Please login to merge, or discard this patch.
autoloader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
 
22 22
 			$previous_path = '';
23 23
 			for ( $i = 0; $i < $levels; $i++ ) {
24
-				$paths[] = $path . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename;
25
-				$previous_path .= strtolower( $exploded[ $i ] ) . '/';
24
+				$paths[] = $path . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename;
25
+				$previous_path .= strtolower( $exploded[$i] ) . '/';
26 26
 			}
27 27
 
28 28
 			foreach ( $paths as $path ) {
Please login to merge, or discard this patch.
includes/class-kirki-field.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			/**
53 53
 			 * Get the config arguments
54 54
 			 */
55
-			$config = Kirki::$config[ $config_id ];
55
+			$config = Kirki::$config[$config_id];
56 56
 			/**
57 57
 			 * Sanitize option_name
58 58
 			 */
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			/**
153 153
 			 * Add the field to the static $fields variable properly indexed
154 154
 			 */
155
-			Kirki::$fields[ $args['settings'] ] = $args;
155
+			Kirki::$fields[$args['settings']] = $args;
156 156
 
157 157
 			if ( 'background' == $args['type'] ) {
158 158
 				/**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			/**
197 197
 			 * If the defined config does not exist, use global.
198 198
 			 */
199
-			if ( ! isset( Kirki::$config[ $config_id ] ) ) {
199
+			if ( ! isset( Kirki::$config[$config_id] ) ) {
200 200
 				$config_id = 'global';
201 201
 			}
202 202
 			return esc_attr( $config_id );
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 			/**
222 222
 			 * Try to get the option_name from the config
223 223
 			 */
224
-			if ( isset( Kirki::$config[ $config_id ]['option_name'] ) ) {
225
-				return esc_attr( Kirki::$config[ $config_id ]['option_name'] );
224
+			if ( isset( Kirki::$config[$config_id]['option_name'] ) ) {
225
+				return esc_attr( Kirki::$config[$config_id]['option_name'] );
226 226
 			}
227 227
 			/**
228 228
 			 * If all else fails, return empty.
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 			/**
251 251
 			 * Try to get the capability from the config
252 252
 			 */
253
-			if ( isset( Kirki::$config[ $config_id ]['capability'] ) ) {
254
-				return esc_attr( Kirki::$config[ $config_id ]['capability'] );
253
+			if ( isset( Kirki::$config[$config_id]['capability'] ) ) {
254
+				return esc_attr( Kirki::$config[$config_id]['capability'] );
255 255
 			}
256 256
 			/**
257 257
 			 * If all else fails, return edit_theme_options.
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
 			/**
280 280
 			 * Try to get the option_type from the config
281 281
 			 */
282
-			if ( isset( Kirki::$config[ $config_id ]['option_type'] ) ) {
283
-				return esc_attr( Kirki::$config[ $config_id ]['option_type'] );
282
+			if ( isset( Kirki::$config[$config_id]['option_type'] ) ) {
283
+				return esc_attr( Kirki::$config[$config_id]['option_type'] );
284 284
 			}
285 285
 			/**
286 286
 			 * If all else fails, return option_type.
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
 			if ( is_array( $args['settings'] ) ) {
314 314
 				$settings = array();
315 315
 				foreach ( $args['settings'] as $setting_key => $setting_value ) {
316
-					$settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value );
316
+					$settings[sanitize_key( $setting_key )] = esc_attr( $setting_value );
317 317
 					/**
318 318
 					 * If we're using serialized options then we may need to modify things a bit
319 319
 					 */
320 320
 					if ( 'option' == $args['option_type'] && '' != $args['option_name'] && ( false === strpos( $setting_key, '[' ) ) ) {
321
-						$settings[ sanitize_key( $setting_key ) ] = esc_attr( $args['option_name'] ).'['.esc_attr( $setting_value ).']';
321
+						$settings[sanitize_key( $setting_key )] = esc_attr( $args['option_name'] ) . '[' . esc_attr( $setting_value ) . ']';
322 322
 					}
323 323
 				}
324 324
 				return $settings;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 			);
527 527
 
528 528
 			if ( array_key_exists( $args['type'], $default_callbacks ) ) {
529
-				return $default_callbacks[ $args['type'] ];
529
+				return $default_callbacks[$args['type']];
530 530
 			} else {
531 531
 				return array( 'Kirki_Sanitize_Values', 'unfiltered' );
532 532
 			}
Please login to merge, or discard this patch.
includes/class-kirki-fonts.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			$google_fonts = array();
96 96
 			if ( is_array( $fonts ) ) {
97 97
 				foreach ( $fonts['items'] as $font ) {
98
-					$google_fonts[ $font['family'] ] = array(
98
+					$google_fonts[$font['family']] = array(
99 99
 						'label'    => $font['family'],
100 100
 						'variants' => $font['variants'],
101 101
 						'subsets'  => $font['subsets'],
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$fonts = self::get_all_fonts();
147 147
 		$fonts_array = array();
148 148
 		foreach ( $fonts as $key => $args ) {
149
-			$fonts_array[ $key ] = $key;
149
+			$fonts_array[$key] = $key;
150 150
 		}
151 151
 		return $fonts_array;
152 152
 	}
Please login to merge, or discard this patch.
includes/customizer/scripts/class-kirki-customizer-scripts-postmessage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 			 * then use the 'output' argument to auto-generate the js_vars
54 54
 			 */
55 55
 			$config_id = ( isset( $args['kirki_config'] ) ) ? $args['kirki_config'] : 'global';
56
-			if ( isset( Kirki::$config[ $config_id ]['postMessage'] ) && 'auto' == Kirki::$config[ $config_id ]['postMessage'] ) {
56
+			if ( isset( Kirki::$config[$config_id]['postMessage'] ) && 'auto' == Kirki::$config[$config_id]['postMessage'] ) {
57 57
 				if ( ! isset( $args['js_vars'] ) || empty( $args['js_vars'] ) ) {
58 58
 					if ( isset( $args['output'] ) ) {
59 59
 						$args['js_vars']   = $args['output'];
Please login to merge, or discard this patch.
includes/googlefonts/class-kirki-googlefonts-field-processor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 			if ( isset( $field['output'] ) && is_array( $field['output'] ) ) {
64 64
 				foreach ( $field['output'] as $output ) {
65 65
 					// If we don't have a typography-related output argument we can skip this.
66
-					if ( ! isset( $output['property'] ) ||  ! in_array( $output['property'], array( 'font-family', 'font-weight', 'font-subset', 'subset', 'font-style' ) ) ) {
66
+					if ( ! isset( $output['property'] ) || ! in_array( $output['property'], array( 'font-family', 'font-weight', 'font-subset', 'subset', 'font-style' ) ) ) {
67 67
 						continue;
68 68
 					}
69 69
 					// Get the value
Please login to merge, or discard this patch.
includes/googlefonts/class-kirki-googlefonts-loader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 		self::$link  = 'https://fonts.googleapis.com/css?family=';
57 57
 		self::$link .= implode( '|', $link_fonts );
58 58
 		if ( ! empty( $all_subsets ) ) {
59
-			self::$link  .= '&subset=' . implode( ',', $all_subsets );
59
+			self::$link .= '&subset=' . implode( ',', $all_subsets );
60 60
 		}
61 61
 
62 62
 	}
Please login to merge, or discard this patch.
includes/googlefonts/class-kirki-googlefonts-manager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
 		// Get all valid font variants for this font
68 68
 		$font_variants = array();
69
-		if ( isset( $google_fonts[ $family ]['variants'] ) ) {
70
-			$font_variants = $google_fonts[ $family ]['variants'];
69
+		if ( isset( $google_fonts[$family]['variants'] ) ) {
70
+			$font_variants = $google_fonts[$family]['variants'];
71 71
 		}
72 72
 
73 73
 		// format the requested variant
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 
82 82
 		// Get all available subsets for this font
83 83
 		$font_subsets = array();
84
-		if ( isset( $google_fonts[ $family ]['subsets'] ) ) {
85
-			$font_subsets = $google_fonts[ $family ]['subsets'];
84
+		if ( isset( $google_fonts[$family]['subsets'] ) ) {
85
+			$font_subsets = $google_fonts[$family]['subsets'];
86 86
 		}
87 87
 
88 88
 		// Get the valid subsets for this font
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 			$requested_subsets = $font_subsets;
94 94
 		}
95 95
 
96
-		self::$fonts[ $family ] = array(
96
+		self::$fonts[$family] = array(
97 97
 			'subsets' => $requested_subsets,
98 98
 		);
99
-		if ( ! isset( self::$fonts[ $family ]['variants'] ) ) {
100
-			self::$fonts[ $family ]['variants'] = array();
99
+		if ( ! isset( self::$fonts[$family]['variants'] ) ) {
100
+			self::$fonts[$family]['variants'] = array();
101 101
 		}
102 102
 		if ( $variant_is_valid ) {
103
-			self::$fonts[ $family ]['variants'][] =$requested_variant;
103
+			self::$fonts[$family]['variants'][] = $requested_variant;
104 104
 		}
105 105
 
106 106
 	}
Please login to merge, or discard this patch.