@@ -257,13 +257,13 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | // Get the config arguments, and merge them with the defaults. |
| 259 | 259 | $config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array(); |
| 260 | - if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) { |
|
| 261 | - $config_defaults = Kirki::$config[ $this->kirki_config ]; |
|
| 260 | + if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) { |
|
| 261 | + $config_defaults = Kirki::$config[$this->kirki_config]; |
|
| 262 | 262 | } |
| 263 | 263 | $config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array(); |
| 264 | 264 | foreach ( $config_defaults as $key => $value ) { |
| 265 | - if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value !== $defaults[ $key ] ) { |
|
| 266 | - $defaults[ $key ] = $value; |
|
| 265 | + if ( isset( $defaults[$key] ) && ! empty( $value ) && $value !== $defaults[$key] ) { |
|
| 266 | + $defaults[$key] = $value; |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | // Get all arguments with their values. |
| 309 | 309 | $args = get_object_vars( $this ); |
| 310 | 310 | foreach ( array_keys( $args ) as $key ) { |
| 311 | - $args[ $key ] = $this->$key; |
|
| 311 | + $args[$key] = $this->$key; |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | // Add the field to the static $fields variable properly indexed. |
| 315 | - Kirki::$fields[ $this->settings ] = $args; |
|
| 315 | + Kirki::$fields[$this->settings] = $args; |
|
| 316 | 316 | |
| 317 | 317 | } |
| 318 | 318 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) { |
| 408 | 408 | /* translators: %1$s represents the field ID where the error occurs. */ |
| 409 | 409 | _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); |
| 410 | - unset( $this->partial_refresh[ $id ] ); |
|
| 410 | + unset( $this->partial_refresh[$id] ); |
|
| 411 | 411 | continue; |
| 412 | 412 | } |
| 413 | 413 | } |
@@ -435,10 +435,10 @@ discard block |
||
| 435 | 435 | } |
| 436 | 436 | $settings = array(); |
| 437 | 437 | foreach ( $this->settings as $setting_key => $setting_value ) { |
| 438 | - $settings[ $setting_key ] = $setting_value; |
|
| 438 | + $settings[$setting_key] = $setting_value; |
|
| 439 | 439 | // If we're using serialized options then we need to spice this up. |
| 440 | 440 | if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) { |
| 441 | - $settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]"; |
|
| 441 | + $settings[$setting_key] = "{$this->option_name}[{$setting_value}]"; |
|
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | $this->settings = $settings; |
@@ -563,17 +563,17 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | foreach ( $this->output as $key => $output ) { |
| 565 | 565 | if ( empty( $output ) || ! isset( $output['element'] ) ) { |
| 566 | - unset( $this->output[ $key ] ); |
|
| 566 | + unset( $this->output[$key] ); |
|
| 567 | 567 | continue; |
| 568 | 568 | } |
| 569 | 569 | if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) { |
| 570 | - $this->output[ $key ]['sanitize_callback'] = $output['callback']; |
|
| 570 | + $this->output[$key]['sanitize_callback'] = $output['callback']; |
|
| 571 | 571 | } |
| 572 | 572 | // Convert element arrays to strings. |
| 573 | 573 | if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { |
| 574 | - $this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] ); |
|
| 575 | - sort( $this->output[ $key ]['element'] ); |
|
| 576 | - $this->output[ $key ]['element'] = implode( ',', $this->output[ $key ]['element'] ); |
|
| 574 | + $this->output[$key]['element'] = array_unique( $this->output[$key]['element'] ); |
|
| 575 | + sort( $this->output[$key]['element'] ); |
|
| 576 | + $this->output[$key]['element'] = implode( ',', $this->output[$key]['element'] ); |
|
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | 579 | } |