Add protocol to URLs for thumbnails in cart.

Removed wc_get_relative_url(), as it's not used anymore.
This commit is contained in:
Peter Fabian 2018-05-02 14:34:50 +02:00
parent 390288e283
commit 8789642fb9
3 changed files with 3 additions and 14 deletions

View File

@ -1809,7 +1809,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$image = '';
}
return apply_filters( 'woocommerce_product_get_image', wc_get_relative_url( $image ), $this, $size, $attr, $placeholder, $image );
return apply_filters( 'woocommerce_product_get_image', $image, $this, $size, $attr, $placeholder );
}
/**

View File

@ -1997,17 +1997,6 @@ function wc_delete_expired_transients() {
}
add_action( 'woocommerce_installed', 'wc_delete_expired_transients' );
/**
* Make a URL relative, if possible.
*
* @since 3.2.0
* @param string $url URL to make relative.
* @return string
*/
function wc_get_relative_url( $url ) {
return wc_is_external_resource( $url ) ? $url : str_replace( array( 'http://', 'https://' ), '//', $url );
}
/**
* See if a resource is remote.
*

View File

@ -51,10 +51,10 @@ do_action( 'woocommerce_before_mini_cart' ); ?>
), $cart_item_key );
?>
<?php if ( empty( $product_permalink ) ) : ?>
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . '&nbsp;'; ?>
<?php echo $thumbnail . $product_name . '&nbsp;'; ?>
<?php else : ?>
<a href="<?php echo esc_url( $product_permalink ); ?>">
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . '&nbsp;'; ?>
<?php echo $thumbnail . $product_name . '&nbsp;'; ?>
</a>
<?php endif; ?>
<?php echo wc_get_formatted_cart_item_data( $cart_item ); ?>