@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $this->control_types = $this->default_control_types( apply_filters( 'kirki/control_types', $this->control_types ) ); |
| 168 | 168 | foreach ( $this->control_types as $key => $classname ) { |
| 169 | 169 | if ( ! class_exists( $classname ) ) { |
| 170 | - unset( $control_types[ $key ] ); |
|
| 170 | + unset( $control_types[$key] ); |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | foreach ( Kirki::$panels as $panel_args ) { |
| 194 | 194 | // Extra checks for nested panels. |
| 195 | 195 | if ( isset( $panel_args['panel'] ) ) { |
| 196 | - if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) { |
|
| 196 | + if ( isset( Kirki::$panels[$panel_args['panel']] ) ) { |
|
| 197 | 197 | // Set the type to nested. |
| 198 | 198 | $panel_args['type'] = 'kirki-nested'; |
| 199 | 199 | } |
@@ -215,11 +215,11 @@ discard block |
||
| 215 | 215 | foreach ( Kirki::$sections as $section_args ) { |
| 216 | 216 | // Extra checks for nested sections. |
| 217 | 217 | if ( isset( $section_args['section'] ) ) { |
| 218 | - if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) { |
|
| 218 | + if ( isset( Kirki::$sections[$section_args['section']] ) ) { |
|
| 219 | 219 | // Set the type to nested. |
| 220 | 220 | $section_args['type'] = 'kirki-nested'; |
| 221 | 221 | // We need to check if the parent section is nested inside a panel. |
| 222 | - $parent_section = Kirki::$sections[ $section_args['section'] ]; |
|
| 222 | + $parent_section = Kirki::$sections[$section_args['section']]; |
|
| 223 | 223 | if ( isset( $parent_section['panel'] ) ) { |
| 224 | 224 | $section_args['panel'] = $parent_section['panel']; |
| 225 | 225 | } |
@@ -335,13 +335,13 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | // Get the config arguments, and merge them with the defaults. |
| 337 | 337 | $config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array(); |
| 338 | - if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) { |
|
| 339 | - $config_defaults = Kirki::$config[ $this->kirki_config ]; |
|
| 338 | + if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) { |
|
| 339 | + $config_defaults = Kirki::$config[$this->kirki_config]; |
|
| 340 | 340 | } |
| 341 | 341 | $config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array(); |
| 342 | 342 | foreach ( $config_defaults as $key => $value ) { |
| 343 | - if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value != $defaults[ $key ] ) { |
|
| 344 | - $defaults[ $key ] = $value; |
|
| 343 | + if ( isset( $defaults[$key] ) && ! empty( $value ) && $value != $defaults[$key] ) { |
|
| 344 | + $defaults[$key] = $value; |
|
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | |
@@ -378,8 +378,8 @@ discard block |
||
| 378 | 378 | // Remove any whitelisted properties from above. |
| 379 | 379 | // These will get a free pass, completely unfiltered. |
| 380 | 380 | foreach ( $whitelisted_properties as $key => $default_value ) { |
| 381 | - if ( isset( $properties[ $key ] ) ) { |
|
| 382 | - unset( $properties[ $key ] ); |
|
| 381 | + if ( isset( $properties[$key] ) ) { |
|
| 382 | + unset( $properties[$key] ); |
|
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | // Get all arguments with their values. |
| 412 | 412 | $args = get_object_vars( $this ); |
| 413 | 413 | foreach ( $args as $key => $default_value ) { |
| 414 | - $args[ $key ] = $this->$key; |
|
| 414 | + $args[$key] = $this->$key; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | // Add the whitelisted properties through the back door. |
@@ -419,11 +419,11 @@ discard block |
||
| 419 | 419 | if ( ! isset( $this->$key ) ) { |
| 420 | 420 | $this->$key = $default_value; |
| 421 | 421 | } |
| 422 | - $args[ $key ] = $this->$key; |
|
| 422 | + $args[$key] = $this->$key; |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | // Add the field to the static $fields variable properly indexed. |
| 426 | - Kirki::$fields[ $this->settings ] = $args; |
|
| 426 | + Kirki::$fields[$this->settings] = $args; |
|
| 427 | 427 | |
| 428 | 428 | } |
| 429 | 429 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) { |
| 531 | 531 | /* translators: %1$s represents the field ID where the error occurs. */ |
| 532 | 532 | _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); |
| 533 | - unset( $this->partial_refresh[ $id ] ); |
|
| 533 | + unset( $this->partial_refresh[$id] ); |
|
| 534 | 534 | continue; |
| 535 | 535 | } |
| 536 | 536 | } |
@@ -558,10 +558,10 @@ discard block |
||
| 558 | 558 | } |
| 559 | 559 | $settings = array(); |
| 560 | 560 | foreach ( $this->settings as $setting_key => $setting_value ) { |
| 561 | - $settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value ); |
|
| 561 | + $settings[sanitize_key( $setting_key )] = esc_attr( $setting_value ); |
|
| 562 | 562 | // If we're using serialized options then we need to spice this up. |
| 563 | 563 | if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) { |
| 564 | - $settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']'; |
|
| 564 | + $settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']'; |
|
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | $this->settings = $settings; |
@@ -67,9 +67,9 @@ |
||
| 67 | 67 | |
| 68 | 68 | // Make sure that every row is an array, not an object. |
| 69 | 69 | foreach ( $sanitized as $key => $_value ) { |
| 70 | - $sanitized[ $key ] = (array) $_value; |
|
| 70 | + $sanitized[$key] = (array) $_value; |
|
| 71 | 71 | if ( empty( $_value ) ) { |
| 72 | - unset( $sanitized[ $key ] ); |
|
| 72 | + unset( $sanitized[$key] ); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |