From aadaf5f08513f0bc5ce5d8d237917607fcb24d51 Mon Sep 17 00:00:00 2001 From: Aristeides Stathopoulos Date: Wed, 13 Dec 2017 22:16:33 +0200 Subject: [PATCH] fixes #1697 --- docs/files/class-my-theme-kirki.php | 3 ++- .../property/class-kirki-output-property-background-image.php | 4 ++-- readme.txt | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/files/class-my-theme-kirki.php b/docs/files/class-my-theme-kirki.php index a6cbc164b..44e0fca04 100644 --- a/docs/files/class-my-theme-kirki.php +++ b/docs/files/class-my-theme-kirki.php @@ -310,7 +310,7 @@ public function get_styles() { $output['property'] = $output['property'] . '-' . $key; } if ( 'background-image' === $output['property'] && false === strpos( $subvalue, 'url(' ) ) { - $subvalue = 'url("' . $subvalue . '")'; + $subvalue = 'url("' . set_url_scheme( $subvalue ) . '")'; } if ( $subvalue ) { $css[ $output['media_query'] ][ $output['element'] ][ $property ] = $subvalue; @@ -342,6 +342,7 @@ public function get_styles() { // Make sure background-images are properly formatted. if ( 'background-image' === $property ) { if ( false === strrpos( $value, 'url(' ) ) { + $value = set_url_scheme( $value ); $value = 'url("' . esc_url_raw( $value ) . '")'; } } else { diff --git a/modules/css/property/class-kirki-output-property-background-image.php b/modules/css/property/class-kirki-output-property-background-image.php index 03ef1bcbb..9904df10d 100644 --- a/modules/css/property/class-kirki-output-property-background-image.php +++ b/modules/css/property/class-kirki-output-property-background-image.php @@ -31,9 +31,9 @@ protected function process_value() { } if ( preg_match( '/^\d+$/', $this->value ) ) { - $this->value = 'url("' . wp_get_attachment_url( $this->value ) . '")'; + $this->value = 'url("' . set_url_scheme( wp_get_attachment_url( $this->value ) ) . '")'; } else { - $this->value = 'url("' . $this->value . '")'; + $this->value = 'url("' . set_url_scheme( $this->value ) . '")'; } } } diff --git a/readme.txt b/readme.txt index 156dbf8c1..e83b85dc3 100644 --- a/readme.txt +++ b/readme.txt @@ -35,7 +35,8 @@ If you want to integrate Kirki in your theme or plugin, please read the instruct = 3.0.20 = -* Fix: Use `repeat` instead of `repeat-all` in background controls. +* Fix: Use `repeat` instead of `repeat-all` in background controls [#1701](https://github.com/aristath/kirki/issues/1701) +* Fix: Use `set_url_scheme()` when outputing images [#1697](https://github.com/aristath/kirki/issues/1697) = 3.0.19 =