Completed
Pull Request — develop (#1515)
by
unknown
03:04
created
modules/webfonts/class-kirki-modules-webfonts-link.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,8 +130,8 @@
 block discarded – undo
130 130
 		// Are we force-loading all subsets?
131 131
 		if ( true === Kirki_Fonts_Google::$force_load_all_subsets ) {
132 132
 
133
-			if ( isset( $this->googlefonts->fonts[ $font ]['subsets'] ) ) {
134
-				foreach ( $this->googlefonts->fonts[ $font ]['subsets'] as $subset ) {
133
+			if ( isset( $this->googlefonts->fonts[$font]['subsets'] ) ) {
134
+				foreach ( $this->googlefonts->fonts[$font]['subsets'] as $subset ) {
135 135
 					$this->subsets[] = $subset;
136 136
 				}
137 137
 			}
Please login to merge, or discard this patch.
modules/postmessage/class-kirki-modules-postmessage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
 			$js_var['index_key'] = $key;
143 143
 			$callback = $this->get_callback( $args );
144 144
 			if ( is_callable( $callback ) ) {
145
-				$field['scripts'][ $key ] = call_user_func_array( $callback, array( $js_var, $args ) );
145
+				$field['scripts'][$key] = call_user_func_array( $callback, array( $js_var, $args ) );
146 146
 				continue;
147 147
 			}
148
-			$field['scripts'][ $key ] = $this->script_var( $js_var );
148
+			$field['scripts'][$key] = $this->script_var( $js_var );
149 149
 		}
150 150
 		$combo_extra_script = '';
151 151
 		$combo_css_script   = '';
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	protected function script_html_var( $args ) {
179 179
 
180
-		$script  = ( isset( $args['choice'] ) ) ? "newval=newval['{$args['choice']}'];" : '';
180
+		$script = ( isset( $args['choice'] ) ) ? "newval=newval['{$args['choice']}'];" : '';
181 181
 
182 182
 		// Apply the value_pattern.
183 183
 		if ( isset( $args['value_pattern'] ) && '' !== $args['value_pattern'] ) {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 		$property_script = '';
252 252
 
253 253
 		// Define choice.
254
-		$choice  = ( isset( $args['choice'] ) && '' !== $args['choice'] ) ? $args['choice'] : '';
254
+		$choice = ( isset( $args['choice'] ) && '' !== $args['choice'] ) ? $args['choice'] : '';
255 255
 
256 256
 		$value_key = 'newval' . $args['index_key'];
257 257
 		$property_script .= $value_key . '=newval;';
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			'font-weight'    => 'fontWeight',
343 343
 			'font-style'     => 'fontStyle',
344 344
 		);
345
-		$choice_condition = ( isset( $args['choice'] ) && '' !== $args['choice'] && isset( $css_build_array[ $args['choice'] ] ) );
345
+		$choice_condition = ( isset( $args['choice'] ) && '' !== $args['choice'] && isset( $css_build_array[$args['choice']] ) );
346 346
 		$script .= ( ! $choice_condition ) ? $webfont_loader : '';
347 347
 		foreach ( $css_build_array as $property => $var ) {
348 348
 			if ( $choice_condition && $property !== $args['choice'] ) {
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 			'units'         => '',
454 454
 			'js_callback'   => array( '', '' ),
455 455
 			'value_pattern' => '',
456
-		));
456
+		) );
457 457
 
458 458
 		// Element should be a string.
459 459
 		if ( is_array( $args['element'] ) ) {
Please login to merge, or discard this patch.
core/class-kirki.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
 		$config = Kirki_Config::get_instance( $config_id, $args );
116 116
 		$config_args = $config->get_config();
117
-		self::$config[ $config_args['id'] ] = $config_args;
117
+		self::$config[$config_args['id']] = $config_args;
118 118
 	}
119 119
 
120 120
 	/**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 			$args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true';
137 137
 		}
138 138
 
139
-		self::$panels[ $args['id'] ] = $args;
139
+		self::$panels[$args['id']] = $args;
140 140
 	}
141 141
 
142 142
 	/**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			$args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true';
160 160
 		}
161 161
 
162
-		self::$sections[ $args['id'] ] = $args;
162
+		self::$sections[$args['id']] = $args;
163 163
 	}
164 164
 
165 165
 	/**
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public static function get_config_param( $id, $param ) {
210 210
 
211
-		if ( ! isset( self::$config[ $id ] ) || ! isset( self::$config[ $id ][ $param ] ) ) {
211
+		if ( ! isset( self::$config[$id] ) || ! isset( self::$config[$id][$param] ) ) {
212 212
 			return '';
213 213
 		}
214
-		return self::$config[ $id ][ $param ];
214
+		return self::$config[$id][$param];
215 215
 	}
216 216
 }
Please login to merge, or discard this patch.
modules/customizer-styling/class-kirki-modules-customizer-styling.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		if ( ! isset( $config['color_accent'] ) && ! isset( $config['color_back'] ) ) {
72 72
 			return;
73 73
 		}
74
-		$back     = isset( $config['color_back'] ) ? $config['color_back'] : false;
74
+		$back = isset( $config['color_back'] ) ? $config['color_back'] : false;
75 75
 
76 76
 		$text_on_back              = '';
77 77
 		$border_on_back            = '';
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			$hover_on_back  = ( 90 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 3 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 3 )->toCSS( $back_obj->mode );
94 94
 			$arrows_on_back = ( 50 > $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness + 30 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness - 30 )->toCSS( $back_obj->mode );
95 95
 		}
96
-		$accent     = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false;
96
+		$accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false;
97 97
 		if ( $accent ) {
98 98
 			$accent_obj                = ariColor::newColor( $accent );
99 99
 			$text_on_accent            = ( 60 > $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness + 60 )->toCSS( $accent_obj->mode ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness - 60 )->toCSS( $accent_obj->mode );
Please login to merge, or discard this patch.
modules/css/field/class-kirki-output-field-background.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
 		);
35 35
 
36 36
 		foreach ( array( 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ) as $property ) {
37
-			if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) {
38
-				$this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix'];
37
+			if ( isset( $value[$property] ) && ! empty( $value[$property] ) ) {
38
+				$this->styles[$output['media_query']][$output['element']][$property] = $output['prefix'] . $this->process_property_value( $property, $value[$property] ) . $output['suffix'];
39 39
 			}
40 40
 		}
41 41
 	}
Please login to merge, or discard this patch.
modules/css/field/class-kirki-output-field-typography.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 		);
45 45
 
46 46
 		foreach ( $properties as $property ) {
47
-			if ( ! isset( $value[ $property ] ) || ! $value[ $property ] ) {
47
+			if ( ! isset( $value[$property] ) || ! $value[$property] ) {
48 48
 				continue;
49 49
 			}
50 50
 			if ( isset( $output['choice'] ) && $output['choice'] !== $property ) {
51 51
 				continue;
52 52
 			}
53 53
 
54
-			$property_value = $this->process_property_value( $property, $value[ $property ] );
54
+			$property_value = $this->process_property_value( $property, $value[$property] );
55 55
 			if ( 'font-family' === $property ) {
56 56
 				$value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : '';
57 57
 				$property_value = $this->process_property_value( $property, array(
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			}
62 62
 			$property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property;
63 63
 			$property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value;
64
-			$this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix'];
64
+			$this->styles[$output['media_query']][$output['element']][$property] = $output['prefix'] . $property_value . $output['suffix'];
65 65
 		}
66 66
 	}
67 67
 }
Please login to merge, or discard this patch.
core/class-kirki-util.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,9 +118,9 @@
 block discarded – undo
118 118
 						// If we have a variable_callback defined then get the value of the option
119 119
 						// and run it through the callback function.
120 120
 						// If no callback is defined (false) then just get the value.
121
-						$variables[ $variable_name ] = Kirki_Values::get_value( $field['settings'] );
121
+						$variables[$variable_name] = Kirki_Values::get_value( $field['settings'] );
122 122
 						if ( $variable_callback ) {
123
-							$variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki_Values::get_value( $field['settings'] ) );
123
+							$variables[$variable_name] = call_user_func( $field_variable['callback'], Kirki_Values::get_value( $field['settings'] ) );
124 124
 						}
125 125
 					}
126 126
 				}
Please login to merge, or discard this patch.
core/class-kirki-values.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function typography_field_tweaks( $value, $field_id ) {
42 42
 
43
-		if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['type'] ) ) {
44
-			if ( 'kirki-typography' === Kirki::$fields[ $field_id ]['type'] ) {
43
+		if ( isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[$field_id]['type'] ) ) {
44
+			if ( 'kirki-typography' === Kirki::$fields[$field_id]['type'] ) {
45 45
 
46 46
 				// Sanitize the value.
47 47
 				// This also adds font-weight if it doesn't already exist.
@@ -83,43 +83,43 @@  discard block
 block discarded – undo
83 83
 		$config_id = ( '' === $config_id ) ? 'global' : $config_id;
84 84
 
85 85
 		// Fallback to 'global' if $config_id is not found.
86
-		if ( ! isset( Kirki::$config[ $config_id ] ) ) {
86
+		if ( ! isset( Kirki::$config[$config_id] ) ) {
87 87
 			$config_id = 'global';
88 88
 		}
89 89
 
90
-		if ( 'theme_mod' === Kirki::$config[ $config_id ]['option_type'] ) {
90
+		if ( 'theme_mod' === Kirki::$config[$config_id]['option_type'] ) {
91 91
 
92 92
 			// We're using theme_mods so just get the value using get_theme_mod.
93 93
 			$default_value = null;
94
-			if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['default'] ) ) {
95
-				$default_value = Kirki::$fields[ $field_id ]['default'];
94
+			if ( isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[$field_id]['default'] ) ) {
95
+				$default_value = Kirki::$fields[$field_id]['default'];
96 96
 			}
97 97
 			$value = get_theme_mod( $field_id, $default_value );
98 98
 			return apply_filters( 'kirki/values/get_value', $value, $field_id );
99 99
 		}
100 100
 
101
-		if ( 'option' === Kirki::$config[ $config_id ]['option_type'] ) {
101
+		if ( 'option' === Kirki::$config[$config_id]['option_type'] ) {
102 102
 
103 103
 			// We're using options.
104
-			if ( '' !== Kirki::$config[ $config_id ]['option_name'] ) {
104
+			if ( '' !== Kirki::$config[$config_id]['option_name'] ) {
105 105
 
106 106
 				// Options are serialized as a single option in the db.
107 107
 				// We'll have to get the option and then get the item from the array.
108
-				$options = get_option( Kirki::$config[ $config_id ]['option_name'] );
108
+				$options = get_option( Kirki::$config[$config_id]['option_name'] );
109 109
 
110
-				if ( ! isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ Kirki::$config[ $config_id ]['option_name'] . '[' . $field_id . ']' ] ) ) {
111
-					$field_id = Kirki::$config[ $config_id ]['option_name'] . '[' . $field_id . ']';
110
+				if ( ! isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[Kirki::$config[$config_id]['option_name'] . '[' . $field_id . ']'] ) ) {
111
+					$field_id = Kirki::$config[$config_id]['option_name'] . '[' . $field_id . ']';
112 112
 				}
113
-				$setting_modified = str_replace( ']', '', str_replace( Kirki::$config[ $config_id ]['option_name'] . '[', '', $field_id ) );
113
+				$setting_modified = str_replace( ']', '', str_replace( Kirki::$config[$config_id]['option_name'] . '[', '', $field_id ) );
114 114
 
115
-				$default_value = ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['default'] ) ) ? Kirki::$fields[ $field_id ]['default'] : '';
116
-				$value = ( isset( $options[ $setting_modified ] ) ) ? $options[ $setting_modified ] : $default_value;
115
+				$default_value = ( isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[$field_id]['default'] ) ) ? Kirki::$fields[$field_id]['default'] : '';
116
+				$value = ( isset( $options[$setting_modified] ) ) ? $options[$setting_modified] : $default_value;
117 117
 				$value = maybe_unserialize( $value );
118 118
 				return apply_filters( 'kirki/values/get_value', $value, $field_id );
119 119
 			}
120 120
 
121 121
 			// Each option separately saved in the db.
122
-			$value = get_option( $field_id, Kirki::$fields[ $field_id ]['default'] );
122
+			$value = get_option( $field_id, Kirki::$fields[$field_id]['default'] );
123 123
 			return apply_filters( 'kirki/values/get_value', $value, $field_id );
124 124
 
125 125
 		} // End if().
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 			if ( isset( $field['option_name'] ) && '' !== $field['option_name'] ) {
145 145
 				$all_values = get_option( $field['option_name'], array() );
146 146
 				$sub_setting_id = str_replace( array( ']', $field['option_name'] . '[' ), '', $field['settings'] );
147
-				if ( isset( $all_values[ $sub_setting_id ] ) ) {
148
-					$value = $all_values[ $sub_setting_id ];
147
+				if ( isset( $all_values[$sub_setting_id] ) ) {
148
+					$value = $all_values[$sub_setting_id];
149 149
 				}
150 150
 			} else {
151 151
 				$value = get_option( $field['settings'], $field['default'] );
Please login to merge, or discard this patch.
modules/css/field/class-kirki-output-field-image.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,15 +34,15 @@
 block discarded – undo
34 34
 		) );
35 35
 		if ( is_array( $value ) ) {
36 36
 			if ( isset( $output['choice'] ) && $output['choice'] ) {
37
-				$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value[ $output['choice'] ] ) . $output['units'] . $output['suffix'];
37
+				$this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $this->process_property_value( $output['property'], $value[$output['choice']] ) . $output['units'] . $output['suffix'];
38 38
 				return;
39 39
 			}
40 40
 			if ( isset( $value['url'] ) ) {
41
-				$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix'];
41
+				$this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix'];
42 42
 				return;
43 43
 			}
44 44
 			return;
45 45
 		}
46
-		$this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix'];
46
+		$this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix'];
47 47
 	}
48 48
 }
Please login to merge, or discard this patch.