@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | echo '<style id="kirki-css-vars">'; |
77 | 77 | echo ':root{'; |
78 | 78 | foreach ( $fields as $id => $args ) { |
79 | - if ( ! isset( $args['css_vars'] ) || empty( $args['css_vars'] ) ) { |
|
79 | + if ( ! isset( $args[ 'css_vars' ] ) || empty( $args[ 'css_vars' ] ) ) { |
|
80 | 80 | continue; |
81 | 81 | } |
82 | - $val = Kirki_Values::get_value( $args['kirki_config'], $id ); |
|
83 | - foreach ( $args['css_vars'] as $css_var ) { |
|
84 | - if ( isset( $css_var[2] ) && is_array( $val ) && isset( $val[ $css_var[2] ] ) ) { |
|
85 | - $val = $val[ $css_var[2] ]; |
|
82 | + $val = Kirki_Values::get_value( $args[ 'kirki_config' ], $id ); |
|
83 | + foreach ( $args[ 'css_vars' ] as $css_var ) { |
|
84 | + if ( isset( $css_var[ 2 ] ) && is_array( $val ) && isset( $val[ $css_var[ 2 ] ] ) ) { |
|
85 | + $val = $val[ $css_var[ 2 ] ]; |
|
86 | 86 | } |
87 | - echo esc_attr( $css_var[0] ) . ':' . esc_attr( str_replace( '$', $val, $css_var[1] ) ) . ';'; |
|
87 | + echo esc_attr( $css_var[ 0 ] ) . ':' . esc_attr( str_replace( '$', $val, $css_var[ 1 ] ) ) . ';'; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | echo '}'; |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | $fields = Kirki::$fields; |
106 | 106 | $data = array(); |
107 | 107 | foreach ( $fields as $field ) { |
108 | - if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_vars'] ) && ! empty( $field['css_vars'] ) ) { |
|
109 | - $data[] = $field; |
|
108 | + if ( isset( $field[ 'transport' ] ) && 'postMessage' === $field[ 'transport' ] && isset( $field[ 'css_vars' ] ) && ! empty( $field[ 'css_vars' ] ) ) { |
|
109 | + $data[ ] = $field; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data ); |
@@ -158,41 +158,41 @@ |
||
158 | 158 | // Get the basics from the parent class. |
159 | 159 | parent::to_json(); |
160 | 160 | // Default. |
161 | - $this->json['default'] = $this->setting->default; |
|
161 | + $this->json[ 'default' ] = $this->setting->default; |
|
162 | 162 | if ( isset( $this->default ) ) { |
163 | - $this->json['default'] = $this->default; |
|
163 | + $this->json[ 'default' ] = $this->default; |
|
164 | 164 | } |
165 | 165 | // Required. |
166 | - $this->json['required'] = $this->required; |
|
166 | + $this->json[ 'required' ] = $this->required; |
|
167 | 167 | // Output. |
168 | - $this->json['output'] = $this->output; |
|
168 | + $this->json[ 'output' ] = $this->output; |
|
169 | 169 | // Value. |
170 | - $this->json['value'] = $this->value(); |
|
170 | + $this->json[ 'value' ] = $this->value(); |
|
171 | 171 | // Choices. |
172 | - $this->json['choices'] = $this->choices; |
|
172 | + $this->json[ 'choices' ] = $this->choices; |
|
173 | 173 | // The link. |
174 | - $this->json['link'] = $this->get_link(); |
|
174 | + $this->json[ 'link' ] = $this->get_link(); |
|
175 | 175 | // The ID. |
176 | - $this->json['id'] = $this->id; |
|
176 | + $this->json[ 'id' ] = $this->id; |
|
177 | 177 | // Translation strings. |
178 | - $this->json['l10n'] = $this->l10n(); |
|
178 | + $this->json[ 'l10n' ] = $this->l10n(); |
|
179 | 179 | // The ajaxurl in case we need it. |
180 | - $this->json['ajaxurl'] = admin_url( 'admin-ajax.php' ); |
|
180 | + $this->json[ 'ajaxurl' ] = admin_url( 'admin-ajax.php' ); |
|
181 | 181 | // Input attributes. |
182 | - $this->json['inputAttrs'] = ''; |
|
182 | + $this->json[ 'inputAttrs' ] = ''; |
|
183 | 183 | foreach ( $this->input_attrs as $attr => $value ) { |
184 | - $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
184 | + $this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
185 | 185 | } |
186 | 186 | // The kirki-config. |
187 | - $this->json['kirkiConfig'] = $this->kirki_config; |
|
187 | + $this->json[ 'kirkiConfig' ] = $this->kirki_config; |
|
188 | 188 | // The option-type. |
189 | - $this->json['kirkiOptionType'] = $this->option_type; |
|
189 | + $this->json[ 'kirkiOptionType' ] = $this->option_type; |
|
190 | 190 | // The option-name. |
191 | - $this->json['kirkiOptionName'] = $this->option_name; |
|
191 | + $this->json[ 'kirkiOptionName' ] = $this->option_name; |
|
192 | 192 | // The preset. |
193 | - $this->json['preset'] = $this->preset; |
|
193 | + $this->json[ 'preset' ] = $this->preset; |
|
194 | 194 | // The CSS-Variables. |
195 | - $this->json['css-var'] = $this->css_vars; |
|
195 | + $this->json[ 'css-var' ] = $this->css_vars; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // Handle the arguments, merge one by one. |
39 | 39 | $args = func_get_args(); |
40 | - $array = $args[0]; |
|
40 | + $array = $args[ 0 ]; |
|
41 | 41 | if ( ! is_array( $array ) ) { |
42 | 42 | return $array; |
43 | 43 | } |
@@ -93,27 +93,27 @@ discard block |
||
93 | 93 | |
94 | 94 | if ( 'ftpext' === $method ) { |
95 | 95 | // If defined, set it to that, Else, set to NULL. |
96 | - $credentials['hostname'] = defined( 'FTP_HOST' ) ? preg_replace( '|\w+://|', '', FTP_HOST ) : null; |
|
97 | - $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : null; |
|
98 | - $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : null; |
|
96 | + $credentials[ 'hostname' ] = defined( 'FTP_HOST' ) ? preg_replace( '|\w+://|', '', FTP_HOST ) : null; |
|
97 | + $credentials[ 'username' ] = defined( 'FTP_USER' ) ? FTP_USER : null; |
|
98 | + $credentials[ 'password' ] = defined( 'FTP_PASS' ) ? FTP_PASS : null; |
|
99 | 99 | |
100 | 100 | // Set FTP port. |
101 | - if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) { |
|
102 | - list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 ); |
|
103 | - if ( ! is_numeric( $credentials['port'] ) ) { |
|
104 | - unset( $credentials['port'] ); |
|
101 | + if ( strpos( $credentials[ 'hostname' ], ':' ) && null !== $credentials[ 'hostname' ] ) { |
|
102 | + list( $credentials[ 'hostname' ], $credentials[ 'port' ] ) = explode( ':', $credentials[ 'hostname' ], 2 ); |
|
103 | + if ( ! is_numeric( $credentials[ 'port' ] ) ) { |
|
104 | + unset( $credentials[ 'port' ] ); |
|
105 | 105 | } |
106 | 106 | } else { |
107 | - unset( $credentials['port'] ); |
|
107 | + unset( $credentials[ 'port' ] ); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | // Set connection type. |
111 | 111 | if ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $method ) { |
112 | - $credentials['connection_type'] = 'ftps'; |
|
112 | + $credentials[ 'connection_type' ] = 'ftps'; |
|
113 | 113 | } elseif ( ! array_filter( $credentials ) ) { |
114 | - $credentials['connection_type'] = null; |
|
114 | + $credentials[ 'connection_type' ] = null; |
|
115 | 115 | } else { |
116 | - $credentials['connection_type'] = 'ftp'; |
|
116 | + $credentials[ 'connection_type' ] = 'ftp'; |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | if ( ! empty( $attachment ) ) { |
154 | - return $attachment[0]; |
|
154 | + return $attachment[ 0 ]; |
|
155 | 155 | } |
156 | 156 | return 0; |
157 | 157 | } |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | $image = wp_get_attachment_image_src( $image_id, 'full' ); |
169 | 169 | |
170 | 170 | return array( |
171 | - 'url' => $image[0], |
|
172 | - 'width' => $image[1], |
|
173 | - 'height' => $image[2], |
|
174 | - 'thumbnail' => $image[3], |
|
171 | + 'url' => $image[ 0 ], |
|
172 | + 'width' => $image[ 1 ], |
|
173 | + 'height' => $image[ 2 ], |
|
174 | + 'thumbnail' => $image[ 3 ], |
|
175 | 175 | ); |
176 | 176 | |
177 | 177 | } |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | 'suppress_filters' => false, |
193 | 193 | ) |
194 | 194 | ); |
195 | - } elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) { |
|
196 | - $args['suppress_filters'] = false; |
|
195 | + } elseif ( is_array( $args ) && ! isset( $args[ 'suppress_filters' ] ) ) { |
|
196 | + $args[ 'suppress_filters' ] = false; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | // Get the posts. |
@@ -343,41 +343,41 @@ discard block |
||
343 | 343 | $key = absint( $context ) / 100; |
344 | 344 | if ( 'A100' === $context ) { |
345 | 345 | $key = 10; |
346 | - unset( $colors['grey'] ); |
|
346 | + unset( $colors[ 'grey' ] ); |
|
347 | 347 | } elseif ( 'A200' === $context ) { |
348 | 348 | $key = 11; |
349 | - unset( $colors['grey'] ); |
|
349 | + unset( $colors[ 'grey' ] ); |
|
350 | 350 | } elseif ( 'A400' === $context ) { |
351 | 351 | $key = 12; |
352 | - unset( $colors['grey'] ); |
|
352 | + unset( $colors[ 'grey' ] ); |
|
353 | 353 | } elseif ( 'A700' === $context ) { |
354 | 354 | $key = 13; |
355 | - unset( $colors['grey'] ); |
|
355 | + unset( $colors[ 'grey' ] ); |
|
356 | 356 | } |
357 | - unset( $colors['primary'] ); |
|
357 | + unset( $colors[ 'primary' ] ); |
|
358 | 358 | $position_colors = array(); |
359 | 359 | foreach ( $colors as $color_family ) { |
360 | 360 | if ( isset( $color_family[ $key ] ) ) { |
361 | - $position_colors[] = $color_family[ $key ]; |
|
361 | + $position_colors[ ] = $color_family[ $key ]; |
|
362 | 362 | } |
363 | 363 | } |
364 | 364 | return $position_colors; |
365 | 365 | case 'all': |
366 | - unset( $colors['primary'] ); |
|
366 | + unset( $colors[ 'primary' ] ); |
|
367 | 367 | $all_colors = array(); |
368 | 368 | foreach ( $colors as $color_family ) { |
369 | 369 | foreach ( $color_family as $color ) { |
370 | - $all_colors[] = $color; |
|
370 | + $all_colors[ ] = $color; |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | return $all_colors; |
374 | 374 | case 'primary': |
375 | - return $colors['primary']; |
|
375 | + return $colors[ 'primary' ]; |
|
376 | 376 | default: |
377 | 377 | if ( isset( $colors[ $context ] ) ) { |
378 | 378 | return $colors[ $context ]; |
379 | 379 | } |
380 | - return $colors['primary']; |
|
380 | + return $colors[ 'primary' ]; |
|
381 | 381 | } // End switch(). |
382 | 382 | } |
383 | 383 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $config = apply_filters( 'kirki_config', array() ); |
78 | 78 | |
79 | 79 | // If we have set $config['disable_google_fonts'] to true then do not proceed any further. |
80 | - if ( isset( $config['disable_google_fonts'] ) && true === $config['disable_google_fonts'] ) { |
|
80 | + if ( isset( $config[ 'disable_google_fonts' ] ) && true === $config[ 'disable_google_fonts' ] ) { |
|
81 | 81 | return; |
82 | 82 | } |
83 | 83 | |
@@ -115,57 +115,57 @@ discard block |
||
115 | 115 | global $wp_customize; |
116 | 116 | |
117 | 117 | // Process typography fields. |
118 | - if ( isset( $args['type'] ) && 'kirki-typography' === $args['type'] ) { |
|
118 | + if ( isset( $args[ 'type' ] ) && 'kirki-typography' === $args[ 'type' ] ) { |
|
119 | 119 | |
120 | 120 | // Get the value. |
121 | 121 | $value = Kirki_Values::get_sanitized_field_value( $args ); |
122 | 122 | |
123 | - if ( isset( $value['downloadFont'] ) && $value['downloadFont'] ) { |
|
124 | - $this->hosted_fonts[] = $value['font-family']; |
|
123 | + if ( isset( $value[ 'downloadFont' ] ) && $value[ 'downloadFont' ] ) { |
|
124 | + $this->hosted_fonts[ ] = $value[ 'font-family' ]; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | // If we don't have a font-family then we can skip this. |
128 | - if ( ! $wp_customize && ( ! isset( $value['font-family'] ) || in_array( $value['font-family'], $this->hosted_fonts ) ) ) { |
|
128 | + if ( ! $wp_customize && ( ! isset( $value[ 'font-family' ] ) || in_array( $value[ 'font-family' ], $this->hosted_fonts ) ) ) { |
|
129 | 129 | return; |
130 | 130 | } |
131 | 131 | |
132 | 132 | // If not a google-font, then we can skip this. |
133 | - if ( ! isset( $value['font-family'] ) || ! Kirki_Fonts::is_google_font( $value['font-family'] ) ) { |
|
133 | + if ( ! isset( $value[ 'font-family' ] ) || ! Kirki_Fonts::is_google_font( $value[ 'font-family' ] ) ) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | |
137 | 137 | // Set a default value for variants. |
138 | - if ( ! isset( $value['variant'] ) ) { |
|
139 | - $value['variant'] = 'regular'; |
|
138 | + if ( ! isset( $value[ 'variant' ] ) ) { |
|
139 | + $value[ 'variant' ] = 'regular'; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | // Add the requested google-font. |
143 | - if ( ! isset( $this->fonts[ $value['font-family'] ] ) ) { |
|
144 | - $this->fonts[ $value['font-family'] ] = array(); |
|
143 | + if ( ! isset( $this->fonts[ $value[ 'font-family' ] ] ) ) { |
|
144 | + $this->fonts[ $value[ 'font-family' ] ] = array(); |
|
145 | 145 | } |
146 | - if ( ! in_array( $value['variant'], $this->fonts[ $value['font-family'] ], true ) ) { |
|
147 | - $this->fonts[ $value['font-family'] ][] = $value['variant']; |
|
146 | + if ( ! in_array( $value[ 'variant' ], $this->fonts[ $value[ 'font-family' ] ], true ) ) { |
|
147 | + $this->fonts[ $value[ 'font-family' ] ][ ] = $value[ 'variant' ]; |
|
148 | 148 | } |
149 | 149 | // Are we force-loading all variants? |
150 | 150 | if ( true === self::$force_load_all_variants ) { |
151 | 151 | $all_variants = Kirki_Fonts::get_all_variants(); |
152 | - $args['choices']['variant'] = array_keys( $all_variants ); |
|
152 | + $args[ 'choices' ][ 'variant' ] = array_keys( $all_variants ); |
|
153 | 153 | } |
154 | 154 | |
155 | - if ( ! empty( $args['choices']['variant'] ) && is_array( $args['choices']['variant'] ) ) { |
|
156 | - foreach ( $args['choices']['variant'] as $extra_variant ) { |
|
157 | - $this->fonts[ $value['font-family'] ][] = $extra_variant; |
|
155 | + if ( ! empty( $args[ 'choices' ][ 'variant' ] ) && is_array( $args[ 'choices' ][ 'variant' ] ) ) { |
|
156 | + foreach ( $args[ 'choices' ][ 'variant' ] as $extra_variant ) { |
|
157 | + $this->fonts[ $value[ 'font-family' ] ][ ] = $extra_variant; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
163 | 163 | // Process non-typography fields. |
164 | - if ( isset( $args['output'] ) && is_array( $args['output'] ) ) { |
|
165 | - foreach ( $args['output'] as $output ) { |
|
164 | + if ( isset( $args[ 'output' ] ) && is_array( $args[ 'output' ] ) ) { |
|
165 | + foreach ( $args[ 'output' ] as $output ) { |
|
166 | 166 | |
167 | 167 | // If we don't have a typography-related output argument we can skip this. |
168 | - if ( ! isset( $output['property'] ) || ! in_array( $output['property'], array( 'font-family', 'font-weight' ), true ) ) { |
|
168 | + if ( ! isset( $output[ 'property' ] ) || ! in_array( $output[ 'property' ], array( 'font-family', 'font-weight' ), true ) ) { |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | |
@@ -173,14 +173,14 @@ discard block |
||
173 | 173 | $value = Kirki_Values::get_sanitized_field_value( $args ); |
174 | 174 | |
175 | 175 | if ( is_string( $value ) ) { |
176 | - if ( 'font-family' === $output['property'] ) { |
|
176 | + if ( 'font-family' === $output[ 'property' ] ) { |
|
177 | 177 | if ( ! array_key_exists( $value, $this->fonts ) ) { |
178 | 178 | $this->fonts[ $value ] = array(); |
179 | 179 | } |
180 | - } elseif ( 'font-weight' === $output['property'] ) { |
|
180 | + } elseif ( 'font-weight' === $output[ 'property' ] ) { |
|
181 | 181 | foreach ( $this->fonts as $font => $variants ) { |
182 | 182 | if ( ! in_array( $value, $variants, true ) ) { |
183 | - $this->fonts[ $font ][] = $value; |
|
183 | + $this->fonts[ $font ][ ] = $value; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | |
213 | 213 | // Get all valid font variants for this font. |
214 | 214 | $font_variants = array(); |
215 | - if ( isset( $this->google_fonts[ $font ]['variants'] ) ) { |
|
216 | - $font_variants = $this->google_fonts[ $font ]['variants']; |
|
215 | + if ( isset( $this->google_fonts[ $font ][ 'variants' ] ) ) { |
|
216 | + $font_variants = $this->google_fonts[ $font ][ 'variants' ]; |
|
217 | 217 | } |
218 | 218 | foreach ( $variants as $variant ) { |
219 | 219 |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | public function custom_css() { |
69 | 69 | |
70 | 70 | $config = apply_filters( 'kirki_config', array() ); |
71 | - if ( ! isset( $config['color_accent'] ) && ! isset( $config['color_back'] ) ) { |
|
71 | + if ( ! isset( $config[ 'color_accent' ] ) && ! isset( $config[ 'color_back' ] ) ) { |
|
72 | 72 | return; |
73 | 73 | } |
74 | - $back = isset( $config['color_back'] ) ? $config['color_back'] : false; |
|
74 | + $back = isset( $config[ 'color_back' ] ) ? $config[ 'color_back' ] : false; |
|
75 | 75 | |
76 | 76 | $text_on_back = ''; |
77 | 77 | $border_on_back = ''; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $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 ); |
94 | 94 | $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 ); |
95 | 95 | } |
96 | - $accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false; |
|
96 | + $accent = ( isset( $config[ 'color_accent' ] ) ) ? $config[ 'color_accent' ] : false; |
|
97 | 97 | if ( $accent ) { |
98 | 98 | $accent_obj = ariColor::newColor( $accent ); |
99 | 99 | $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 ); |
@@ -405,18 +405,18 @@ discard block |
||
405 | 405 | color: #444 !important; |
406 | 406 | } |
407 | 407 | |
408 | - <?php if ( isset( $config['width'] ) ) : ?> |
|
408 | + <?php if ( isset( $config[ 'width' ] ) ) : ?> |
|
409 | 409 | .wp-full-overlay-sidebar { |
410 | - width: <?php echo esc_attr( $config['width'] ); ?>; |
|
410 | + width: <?php echo esc_attr( $config[ 'width' ] ); ?>; |
|
411 | 411 | } |
412 | 412 | .expanded .wp-full-overlay-footer { |
413 | - width: <?php echo esc_attr( $config['width'] ); ?>; |
|
413 | + width: <?php echo esc_attr( $config[ 'width' ] ); ?>; |
|
414 | 414 | } |
415 | 415 | .wp-full-overlay.expanded { |
416 | - margin-left: <?php echo esc_attr( $config['width'] ); ?>; |
|
416 | + margin-left: <?php echo esc_attr( $config[ 'width' ] ); ?>; |
|
417 | 417 | } |
418 | 418 | .wp-full-overlay.collapsed .wp-full-overlay-sidebar { |
419 | - margin-left: -<?php echo esc_attr( $config['width'] ); ?>; |
|
419 | + margin-left: -<?php echo esc_attr( $config[ 'width' ] ); ?>; |
|
420 | 420 | } |
421 | 421 | <?php endif; ?> |
422 | 422 | </style> |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | // Return regular if the one we want could not be found. |
206 | - if ( isset( $local_urls['regular'] ) ) { |
|
207 | - return $local_urls['regular']; |
|
206 | + if ( isset( $local_urls[ 'regular' ] ) ) { |
|
207 | + return $local_urls[ 'regular' ]; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | // Return the first available if all else failed. |
211 | 211 | $vals = array_values( $local_urls ); |
212 | - return $vals[0]; |
|
212 | + return $vals[ 0 ]; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | public function get_root_path() { |
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 | // Take care of domain mapping. |
431 | 431 | // When using domain mapping we have to make sure that the URL to the file |
432 | 432 | // does not include the original domain but instead the mapped domain. |
@@ -36,12 +36,12 @@ |
||
36 | 36 | foreach ( array( 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ) as $property ) { |
37 | 37 | |
38 | 38 | // See https://github.com/aristath/kirki/issues/1808. |
39 | - if ( 'background-color' === $property && isset( $value['background-color'] ) && $value['background-color'] && ( ! isset( $value['background-image'] ) || empty( $value['background-image'] ) ) ) { |
|
40 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; |
|
39 | + if ( 'background-color' === $property && isset( $value[ 'background-color' ] ) && $value[ 'background-color' ] && ( ! isset( $value[ 'background-image' ] ) || empty( $value[ 'background-image' ] ) ) ) { |
|
40 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ 'background' ] = $output[ 'prefix' ] . $this->process_property_value( $property, $value[ $property ] ) . $output[ 'suffix' ]; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) { |
44 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; |
|
44 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $output[ 'prefix' ] . $this->process_property_value( $property, $value[ $property ] ) . $output[ 'suffix' ]; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | } |