Fix double tip Closes #1856.
This commit is contained in:
parent
0dd88985d7
commit
a8a1af4ba3
|
@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||
if ( $_product->get_sku() )
|
||||
echo '<br/><strong>' . __( 'Product SKU:', 'woocommerce' ).'</strong> ' . esc_html( $_product->get_sku() );
|
||||
|
||||
?>"><?php echo $_product->get_image(); ?></a>
|
||||
?>"><?php echo $_product->get_image( 'shop_thumbnail', array( 'title' => '' ) ); ?></a>
|
||||
</td>
|
||||
<td class="name">
|
||||
|
||||
|
|
|
@ -1193,15 +1193,15 @@ abstract class WC_Product {
|
|||
* @param string $size (default: 'shop_thumbnail')
|
||||
* @return string
|
||||
*/
|
||||
function get_image( $size = 'shop_thumbnail' ) {
|
||||
function get_image( $size = 'shop_thumbnail', $attr = array() ) {
|
||||
global $woocommerce;
|
||||
|
||||
$image = '';
|
||||
|
||||
if ( has_post_thumbnail( $this->id ) ) {
|
||||
$image = get_the_post_thumbnail( $this->id, $size );
|
||||
$image = get_the_post_thumbnail( $this->id, $size, $attr );
|
||||
} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
|
||||
$image = get_the_post_thumbnail( $parent_id, $size );
|
||||
$image = get_the_post_thumbnail( $parent_id, $size, $attr );
|
||||
} else {
|
||||
$image = woocommerce_placeholder_img( $size );
|
||||
}
|
||||
|
|
|
@ -289,17 +289,17 @@ class WC_Product_Variation extends WC_Product {
|
|||
* @param string $size (default: 'shop_thumbnail')
|
||||
* @return string
|
||||
*/
|
||||
function get_image( $size = 'shop_thumbnail' ) {
|
||||
function get_image( $size = 'shop_thumbnail', $attr = array() ) {
|
||||
global $woocommerce;
|
||||
|
||||
$image = '';
|
||||
|
||||
if ( $this->variation_id && has_post_thumbnail( $this->variation_id ) ) {
|
||||
$image = get_the_post_thumbnail( $this->variation_id, $size );
|
||||
$image = get_the_post_thumbnail( $this->variation_id, $size, $attr );
|
||||
} elseif ( has_post_thumbnail( $this->id ) ) {
|
||||
$image = get_the_post_thumbnail( $this->id, $size );
|
||||
$image = get_the_post_thumbnail( $this->id, $size, $attr );
|
||||
} elseif ( $parent_id = wp_get_post_parent_id( $this->id ) && has_post_thumbnail( $parent_id ) ) {
|
||||
$image = get_the_post_thumbnail( $parent_id, $size );
|
||||
$image = get_the_post_thumbnail( $parent_id, $size , $attr);
|
||||
} else {
|
||||
$image = woocommerce_placeholder_img( $size );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue