@@ -20,8 +20,8 @@ |
||
20 | 20 | * @access protected |
21 | 21 | */ |
22 | 22 | protected function process_value() { |
23 | - if ( is_array( $this->value ) && isset( $this->value['url'] ) ) { |
|
24 | - $this->value = $this->value['url']; |
|
23 | + if ( is_array( $this->value ) && isset( $this->value[ 'url' ] ) ) { |
|
24 | + $this->value = $this->value[ 'url' ]; |
|
25 | 25 | } |
26 | 26 | if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) { |
27 | 27 | if ( empty( $this->value ) ) { |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | * @param array $value The field's value. |
23 | 23 | */ |
24 | 24 | protected function process_output( $output, $value ) { |
25 | - $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
|
26 | - $output['element'] = ( isset( $output['element'] ) ) ? $output['element'] : 'body'; |
|
27 | - $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; |
|
28 | - $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
25 | + $output[ 'media_query' ] = ( isset( $output[ 'media_query' ] ) ) ? $output[ 'media_query' ] : 'global'; |
|
26 | + $output[ 'element' ] = ( isset( $output[ 'element' ] ) ) ? $output[ 'element' ] : 'body'; |
|
27 | + $output[ 'prefix' ] = ( isset( $output[ 'prefix' ] ) ) ? $output[ 'prefix' ] : ''; |
|
28 | + $output[ 'suffix' ] = ( isset( $output[ 'suffix' ] ) ) ? $output[ 'suffix' ] : ''; |
|
29 | 29 | |
30 | 30 | $value = Kirki_Field_Typography::sanitize( $value ); |
31 | 31 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | foreach ( $properties as $property ) { |
48 | 48 | |
49 | 49 | // Early exit if the value is not in the defaults. |
50 | - if ( ! isset( $this->field['default'][ $property ] ) ) { |
|
50 | + if ( ! isset( $this->field[ 'default' ][ $property ] ) ) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | |
@@ -57,39 +57,39 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // Early exit if we use "choice" but not for this property. |
60 | - if ( isset( $output['choice'] ) && $output['choice'] !== $property ) { |
|
60 | + if ( isset( $output[ 'choice' ] ) && $output[ 'choice' ] !== $property ) { |
|
61 | 61 | continue; |
62 | 62 | } |
63 | 63 | |
64 | 64 | // Take care of variants. |
65 | - if ( 'variant' === $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) { |
|
65 | + if ( 'variant' === $property && isset( $value[ 'variant' ] ) && ! empty( $value[ 'variant' ] ) ) { |
|
66 | 66 | |
67 | 67 | // Get the font_weight. |
68 | - $font_weight = str_replace( 'italic', '', $value['variant'] ); |
|
68 | + $font_weight = str_replace( 'italic', '', $value[ 'variant' ] ); |
|
69 | 69 | $font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight; |
70 | 70 | |
71 | 71 | // Is this italic? |
72 | - $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); |
|
73 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight; |
|
72 | + $is_italic = ( false !== strpos( $value[ 'variant' ], 'italic' ) ); |
|
73 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'font-weight' ] = $font_weight; |
|
74 | 74 | if ( $is_italic ) { |
75 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic'; |
|
75 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'font-style' ] = 'italic'; |
|
76 | 76 | } |
77 | 77 | continue; |
78 | 78 | } |
79 | 79 | |
80 | 80 | $property_value = $this->process_property_value( $property, $value[ $property ] ); |
81 | 81 | if ( 'font-family' === $property ) { |
82 | - $value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : ''; |
|
82 | + $value[ 'font-backup' ] = ( isset( $value[ 'font-backup' ] ) ) ? $value[ 'font-backup' ] : ''; |
|
83 | 83 | $property_value = $this->process_property_value( |
84 | 84 | $property, array( |
85 | - $value['font-family'], |
|
86 | - $value['font-backup'], |
|
85 | + $value[ 'font-family' ], |
|
86 | + $value[ 'font-backup' ], |
|
87 | 87 | ) |
88 | 88 | ); |
89 | 89 | } |
90 | - $property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property; |
|
91 | - $property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value; |
|
92 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix']; |
|
90 | + $property = ( isset( $output[ 'choice' ] ) && isset( $output[ 'property' ] ) ) ? $output[ 'property' ] : $property; |
|
91 | + $property_value = ( is_array( $property_value ) && isset( $property_value[ 0 ] ) ) ? $property_value[ 0 ] : $property_value; |
|
92 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $output[ 'prefix' ] . $property_value . $output[ 'suffix' ]; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param array $value The field's value. |
23 | 23 | */ |
24 | 24 | protected function process_output( $output, $value ) { |
25 | - if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) { |
|
25 | + if ( ! isset( $output[ 'element' ] ) || ! isset( $output[ 'property' ] ) ) { |
|
26 | 26 | return; |
27 | 27 | } |
28 | 28 | $output = wp_parse_args( |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | ) |
35 | 35 | ); |
36 | 36 | if ( is_array( $value ) ) { |
37 | - if ( isset( $output['choice'] ) && $output['choice'] ) { |
|
38 | - $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 | + if ( isset( $output[ 'choice' ] ) && $output[ 'choice' ] ) { |
|
38 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value[ $output[ 'choice' ] ] ) . $output[ 'units' ] . $output[ 'suffix' ]; |
|
39 | 39 | return; |
40 | 40 | } |
41 | - if ( isset( $value['url'] ) ) { |
|
42 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix']; |
|
41 | + if ( isset( $value[ 'url' ] ) ) { |
|
42 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value[ 'url' ] ) . $output[ 'units' ] . $output[ 'suffix' ]; |
|
43 | 43 | return; |
44 | 44 | } |
45 | 45 | return; |
46 | 46 | } |
47 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; |
|
47 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value ) . $output[ 'units' ] . $output[ 'suffix' ]; |
|
48 | 48 | } |
49 | 49 | } |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | protected function get_path( $context = '' ) { |
53 | 53 | $upload_dir = wp_upload_dir(); |
54 | 54 | $paths = array( |
55 | - 'file' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css/styles.css' ), |
|
56 | - 'folder' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css' ), |
|
55 | + 'file' => wp_normalize_path( $upload_dir[ 'basedir' ] . '/kirki-css/styles.css' ), |
|
56 | + 'folder' => wp_normalize_path( $upload_dir[ 'basedir' ] . '/kirki-css' ), |
|
57 | 57 | ); |
58 | 58 | |
59 | 59 | if ( 'file' === $context ) { |
60 | - return $paths['file']; |
|
60 | + return $paths[ 'file' ]; |
|
61 | 61 | } |
62 | 62 | if ( 'folder' === $context ) { |
63 | - return $paths['folder']; |
|
63 | + return $paths[ 'folder' ]; |
|
64 | 64 | } |
65 | 65 | return $paths; |
66 | 66 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function get_url() { |
76 | 76 | $upload_dir = wp_upload_dir(); |
77 | - return esc_url_raw( $upload_dir['baseurl'] . '/kirki-css/styles.css' ); |
|
77 | + return esc_url_raw( $upload_dir[ 'baseurl' ] . '/kirki-css/styles.css' ); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -52,15 +52,15 @@ |
||
52 | 52 | ) |
53 | 53 | ); |
54 | 54 | |
55 | - $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
56 | - $array['content'] = $this->get_content(); |
|
57 | - $array['active'] = $this->active(); |
|
58 | - $array['instanceNumber'] = $this->instance_number; |
|
55 | + $array[ 'title' ] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
56 | + $array[ 'content' ] = $this->get_content(); |
|
57 | + $array[ 'active' ] = $this->active(); |
|
58 | + $array[ 'instanceNumber' ] = $this->instance_number; |
|
59 | 59 | |
60 | - $array['customizeAction'] = esc_html__( 'Customizing', 'kirki' ); |
|
60 | + $array[ 'customizeAction' ] = esc_html__( 'Customizing', 'kirki' ); |
|
61 | 61 | if ( $this->panel ) { |
62 | 62 | /* translators: The title. */ |
63 | - $array['customizeAction'] = sprintf( esc_html__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); |
|
63 | + $array[ 'customizeAction' ] = sprintf( esc_html__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); |
|
64 | 64 | } |
65 | 65 | return $array; |
66 | 66 | } |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function custom_css() { |
67 | 67 | $config = apply_filters( 'kirki_config', array() ); |
68 | - if ( ! isset( $config['color_accent'] ) && ! isset( $config['color_back'] ) ) { |
|
68 | + if ( ! isset( $config[ 'color_accent' ] ) && ! isset( $config[ 'color_back' ] ) ) { |
|
69 | 69 | return; |
70 | 70 | } |
71 | - $back = isset( $config['color_back'] ) ? $config['color_back'] : false; |
|
71 | + $back = isset( $config[ 'color_back' ] ) ? $config[ 'color_back' ] : false; |
|
72 | 72 | |
73 | 73 | $text_on_back = ''; |
74 | 74 | $border_on_back = ''; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $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 ); |
91 | 91 | $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 ); |
92 | 92 | } |
93 | - $accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false; |
|
93 | + $accent = ( isset( $config[ 'color_accent' ] ) ) ? $config[ 'color_accent' ] : false; |
|
94 | 94 | if ( $accent ) { |
95 | 95 | $accent_obj = ariColor::newColor( $accent ); |
96 | 96 | $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 ); |
@@ -402,18 +402,18 @@ discard block |
||
402 | 402 | color: #444 !important; |
403 | 403 | } |
404 | 404 | |
405 | - <?php if ( isset( $config['width'] ) ) : ?> |
|
405 | + <?php if ( isset( $config[ 'width' ] ) ) : ?> |
|
406 | 406 | .wp-full-overlay-sidebar { |
407 | - width: <?php echo esc_html( $config['width'] ); ?>; |
|
407 | + width: <?php echo esc_html( $config[ 'width' ] ); ?>; |
|
408 | 408 | } |
409 | 409 | .expanded .wp-full-overlay-footer { |
410 | - width: <?php echo esc_html( $config['width'] ); ?>; |
|
410 | + width: <?php echo esc_html( $config[ 'width' ] ); ?>; |
|
411 | 411 | } |
412 | 412 | .wp-full-overlay.expanded { |
413 | - margin-left: <?php echo esc_html( $config['width'] ); ?>; |
|
413 | + margin-left: <?php echo esc_html( $config[ 'width' ] ); ?>; |
|
414 | 414 | } |
415 | 415 | .wp-full-overlay.collapsed .wp-full-overlay-sidebar { |
416 | - margin-left: -<?php echo esc_html( $config['width'] ); ?>; |
|
416 | + margin-left: -<?php echo esc_html( $config[ 'width' ] ); ?>; |
|
417 | 417 | } |
418 | 418 | <?php endif; ?> |
419 | 419 | </style> |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | // Return regular if the one we want could not be found. |
205 | - if ( isset( $local_urls['regular'] ) ) { |
|
206 | - return $local_urls['regular']; |
|
205 | + if ( isset( $local_urls[ 'regular' ] ) ) { |
|
206 | + return $local_urls[ 'regular' ]; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | // Return the first available if all else failed. |
210 | 210 | $vals = array_values( $local_urls ); |
211 | - return $vals[0]; |
|
211 | + return $vals[ 0 ]; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | |
402 | 402 | // Get the upload directory for this site. |
403 | 403 | $upload_dir = wp_upload_dir(); |
404 | - $path = untrailingslashit( wp_normalize_path( $upload_dir['basedir'] ) ) . '/webfonts'; |
|
404 | + $path = untrailingslashit( wp_normalize_path( $upload_dir[ 'basedir' ] ) ) . '/webfonts'; |
|
405 | 405 | |
406 | 406 | // If the folder doesn't exist, create it. |
407 | 407 | if ( ! file_exists( $path ) ) { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $upload_dir = wp_upload_dir(); |
427 | 427 | |
428 | 428 | // The URL. |
429 | - $url = trailingslashit( $upload_dir['baseurl'] ); |
|
429 | + $url = trailingslashit( $upload_dir[ 'baseurl' ] ); |
|
430 | 430 | |
431 | 431 | // Take care of domain mapping. |
432 | 432 | // When using domain mapping we have to make sure that the URL to the file |
@@ -75,13 +75,13 @@ |
||
75 | 75 | private function parse_fields() { |
76 | 76 | $fields = Kirki::$fields; |
77 | 77 | foreach ( $fields as $field ) { |
78 | - if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) { |
|
78 | + if ( isset( $field[ 'tooltip' ] ) && ! empty( $field[ 'tooltip' ] ) ) { |
|
79 | 79 | // Get the control ID and properly format it for the tooltips. |
80 | - $id = str_replace( '[', '-', str_replace( ']', '', $field['settings'] ) ); |
|
80 | + $id = str_replace( '[', '-', str_replace( ']', '', $field[ 'settings' ] ) ); |
|
81 | 81 | // Add the tooltips content. |
82 | 82 | $this->tooltips_content[ $id ] = array( |
83 | 83 | 'id' => $id, |
84 | - 'content' => $field['tooltip'], |
|
84 | + 'content' => $field[ 'tooltip' ], |
|
85 | 85 | ); |
86 | 86 | } |
87 | 87 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function to_json() { |
36 | 36 | parent::to_json(); |
37 | - $this->json['icons'] = Kirki_Helper::get_dashicons(); |
|
37 | + $this->json[ 'icons' ] = Kirki_Helper::get_dashicons(); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |