Skip to content

Commit

Permalink
fixes #1697
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Dec 13, 2017
1 parent 2ba9848 commit aadaf5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/files/class-my-theme-kirki.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) . '")';
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =

Expand Down

0 comments on commit aadaf5f

Please sign in to comment.