@@ -102,9 +102,9 @@ discard block |
||
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 |
||
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; |
@@ -21,8 +21,8 @@ |
||
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 ) { |
@@ -52,7 +52,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -95,7 +95,7 @@ discard block |
||
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 |
||
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 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | $defaults = isset( $args['default'] ) ? $args['default'] : array(); |
18 | 18 | $sanitize_callback = $args['sanitize_callback']; |
19 | 19 | foreach ( $settings as $setting_key => $setting_value ) { |
20 | - $default = ( isset( $defaults[ $setting_key ] ) ) ? $defaults[ $setting_key ] : ''; |
|
20 | + $default = ( isset( $defaults[$setting_key] ) ) ? $defaults[$setting_key] : ''; |
|
21 | 21 | $transport = isset( $args['transport'] ) ? $args['transport'] : 'refresh'; |
22 | 22 | |
23 | 23 | if ( isset( $args['sanitize_callback'] ) && is_array( $args['sanitize_callback'] ) ) { |
24 | - if ( isset( $args['sanitize_callback'][ $setting_key ] ) ) { |
|
25 | - $sanitize_callback = Kirki_Field::sanitize_callback( '', array( 'sanitize_callback' => $args['sanitize_callback'][ $setting_key ] ) ); |
|
24 | + if ( isset( $args['sanitize_callback'][$setting_key] ) ) { |
|
25 | + $sanitize_callback = Kirki_Field::sanitize_callback( '', array( 'sanitize_callback' => $args['sanitize_callback'][$setting_key] ) ); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | $this->wp_customize->add_setting( $setting_value, array( |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | if ( isset( $args['type'] ) && array_key_exists( $args['type'], Kirki_Control::$setting_types ) ) { |
39 | 39 | // We must instantiate a custom class for the setting |
40 | - $setting_classname = Kirki_Control::$setting_types[ $args['type'] ]; |
|
40 | + $setting_classname = Kirki_Control::$setting_types[$args['type']]; |
|
41 | 41 | $this->wp_customize->add_setting( new $setting_classname( $this->wp_customize, $args['settings'], array( |
42 | 42 | 'default' => isset( $args['default'] ) ? $args['default'] : '', |
43 | 43 | 'type' => $args['option_type'], |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | foreach ( $args['fields'] as $key => $value ) { |
36 | 36 | if ( ! isset( $value['default'] ) ) { |
37 | - $args['fields'][ $key ]['default'] = ''; |
|
37 | + $args['fields'][$key]['default'] = ''; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | if ( ! isset( $value['label'] ) ) { |
41 | - $args['fields'][ $key ]['label'] = ''; |
|
41 | + $args['fields'][$key]['label'] = ''; |
|
42 | 42 | } |
43 | - $args['fields'][ $key ]['id'] = $key; |
|
43 | + $args['fields'][$key]['id'] = $key; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $this->fields = $args['fields']; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | - $fields[ $key ]['buttonLabels'] = $default_image_button_labels; |
|
66 | + $fields[$key]['buttonLabels'] = $default_image_button_labels; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $this->json['fields'] = $fields; |
@@ -26,15 +26,15 @@ |
||
26 | 26 | if ( is_array( $this->choices ) ) { |
27 | 27 | foreach ( $this->choices as $choice => $value ) { |
28 | 28 | if ( true === $value ) { |
29 | - $this->json['choices'][ $choice ] = true; |
|
29 | + $this->json['choices'][$choice] = true; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | 34 | if ( is_array( $this->json['default'] ) ) { |
35 | 35 | foreach ( $this->json['default'] as $key => $value ) { |
36 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
37 | - $this->json['value'][ $key ] = $value; |
|
36 | + if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) { |
|
37 | + $this->json['value'][$key] = $value; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -53,7 +53,7 @@ |
||
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']; |
@@ -63,7 +63,7 @@ |
||
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 |