@@ -114,7 +114,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -101,12 +101,12 @@ discard block |
||
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 ( array_keys( $value ) as $value_k ) { |
108 | - if ( is_string( $value[ $value_k ] ) ) { |
|
109 | - $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] ); |
|
108 | + if ( is_string( $value[$value_k] ) ) { |
|
109 | + $value[$value_k] = str_replace( '$', $value[$value_k], $output['value_pattern'] ); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
@@ -125,16 +125,16 @@ discard block |
||
125 | 125 | if ( is_array( $options ) ) { |
126 | 126 | if ( $option_name ) { |
127 | 127 | $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace ); |
128 | - $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; |
|
128 | + $replacement = ( isset( $options[$subkey] ) ) ? $options[$subkey] : ''; |
|
129 | 129 | break; |
130 | 130 | } |
131 | - $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; |
|
131 | + $replacement = ( isset( $options[$replace] ) ) ? $options[$replace] : ''; |
|
132 | 132 | break; |
133 | 133 | } |
134 | 134 | $replacement = get_option( $replace ); |
135 | 135 | break; |
136 | 136 | case 'site_option': |
137 | - $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); |
|
137 | + $replacement = ( is_array( $options ) && isset( $options[$replace] ) ) ? $options[$replace] : get_site_option( $replace ); |
|
138 | 138 | break; |
139 | 139 | case 'user_meta': |
140 | 140 | $user_id = get_current_user_id(); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $replacement = ( false === $replacement ) ? '' : $replacement; |
150 | 150 | if ( is_array( $value ) ) { |
151 | 151 | foreach ( $value as $k => $v ) { |
152 | - $value[ $k ] = str_replace( $search, $replacement, $value[ $v ] ); |
|
152 | + $value[$k] = str_replace( $search, $replacement, $value[$v] ); |
|
153 | 153 | } |
154 | 154 | return $value; |
155 | 155 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | // If 'choice' is defined check for sub-values too. |
196 | 196 | // Fixes https://github.com/aristath/kirki/issues/1416. |
197 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { |
|
197 | + if ( isset( $output['choice'] ) && isset( $value[$output['choice']] ) && $exclude == $value[$output['choice']] ) { |
|
198 | 198 | $skip = true; |
199 | 199 | } |
200 | 200 | } |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | 'background', |
253 | 253 | ); |
254 | 254 | if ( in_array( $output['property'], $accepts_multiple, true ) ) { |
255 | - if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { |
|
256 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; |
|
255 | + if ( isset( $this->styles[$output['media_query']][$output['element']][$output['property']] ) && ! is_array( $this->styles[$output['media_query']][$output['element']][$output['property']] ) ) { |
|
256 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = (array) $this->styles[$output['media_query']][$output['element']][$output['property']]; |
|
257 | 257 | } |
258 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
258 | + $this->styles[$output['media_query']][$output['element']][$output['property']][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
259 | 259 | return; |
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 | } |
263 | 263 | |
264 | 264 | /** |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | 'background-position' => 'Kirki_Output_Property_Background_Position', |
279 | 279 | ) ); |
280 | 280 | if ( array_key_exists( $property, $properties ) ) { |
281 | - $classname = $properties[ $property ]; |
|
281 | + $classname = $properties[$property]; |
|
282 | 282 | $obj = new $classname( $property, $value ); |
283 | 283 | return $obj->get_value(); |
284 | 284 | } |