Code Duplication    Length = 3-3 lines in 2 locations

includes/class-wc-product-variation.php 1 location

@@ 366-368 (lines=3) @@
363
			$image = get_the_post_thumbnail( $this->variation_id, $size, $attr );
364
		} elseif ( has_post_thumbnail( $this->id ) ) {
365
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
366
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
367
			$image = get_the_post_thumbnail( $parent_id, $size , $attr);
368
		} elseif ( $placeholder ) {
369
			$image = wc_placeholder_img( $size );
370
		} else {
371
			$image = '';

includes/abstracts/abstract-wc-product.php 1 location

@@ 1530-1532 (lines=3) @@
1527
	public function get_image( $size = 'shop_thumbnail', $attr = array(), $placeholder = true ) {
1528
		if ( has_post_thumbnail( $this->id ) ) {
1529
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
1530
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1531
			$image = get_the_post_thumbnail( $parent_id, $size, $attr );
1532
		} elseif ( $placeholder ) {
1533
			$image = wc_placeholder_img( $size );
1534
		} else {
1535
			$image = '';