Code Duplication    Length = 3-3 lines in 2 locations

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

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

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

@@ 1566-1568 (lines=3) @@
1563
	public function get_image( $size = 'shop_thumbnail', $attr = array(), $placeholder = true ) {
1564
		if ( has_post_thumbnail( $this->id ) ) {
1565
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
1566
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1567
			$image = get_the_post_thumbnail( $parent_id, $size, $attr );
1568
		} elseif ( $placeholder ) {
1569
			$image = wc_placeholder_img( $size );
1570
		} else {
1571
			$image = '';