Customize: Use esc_url_raw()
instead of wp_json_encode()
to eliminate extraneous slashes when outputting background image URL in CSS url()
.
Props tyxla, westonruter. See #22058. Fixes #39145. git-svn-id: https://develop.svn.wordpress.org/trunk@39546 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9c5d1f6011
commit
c8eafed944
@ -1554,7 +1554,7 @@ function _custom_background_cb() {
|
||||
$style = $color ? "background-color: #$color;" : '';
|
||||
|
||||
if ( $background ) {
|
||||
$image = " background-image: url(" . wp_json_encode( $background ) . ");";
|
||||
$image = ' background-image: url("' . esc_url_raw( $background ) . '");';
|
||||
|
||||
// Background Position.
|
||||
$position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
|
||||
|
Loading…
Reference in New Issue
Block a user