Add protocol to URLs for thumbnails in cart.
Removed wc_get_relative_url(), as it's not used anymore.
This commit is contained in:
parent
390288e283
commit
8789642fb9
|
@ -1809,7 +1809,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
||||||
$image = '';
|
$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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1997,17 +1997,6 @@ function wc_delete_expired_transients() {
|
||||||
}
|
}
|
||||||
add_action( 'woocommerce_installed', '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.
|
* See if a resource is remote.
|
||||||
*
|
*
|
||||||
|
|
|
@ -51,10 +51,10 @@ do_action( 'woocommerce_before_mini_cart' ); ?>
|
||||||
), $cart_item_key );
|
), $cart_item_key );
|
||||||
?>
|
?>
|
||||||
<?php if ( empty( $product_permalink ) ) : ?>
|
<?php if ( empty( $product_permalink ) ) : ?>
|
||||||
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . ' '; ?>
|
<?php echo $thumbnail . $product_name . ' '; ?>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<a href="<?php echo esc_url( $product_permalink ); ?>">
|
<a href="<?php echo esc_url( $product_permalink ); ?>">
|
||||||
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . ' '; ?>
|
<?php echo $thumbnail . $product_name . ' '; ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php echo wc_get_formatted_cart_item_data( $cart_item ); ?>
|
<?php echo wc_get_formatted_cart_item_data( $cart_item ); ?>
|
||||||
|
|
Loading…
Reference in New Issue