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

@@ 1560-1562 (lines=3) @@
1557
	public function get_image( $size = 'shop_thumbnail', $attr = array(), $placeholder = true ) {
1558
		if ( has_post_thumbnail( $this->id ) ) {
1559
			$image = get_the_post_thumbnail( $this->id, $size, $attr );
1560
		} elseif ( ( $parent_id = wp_get_post_parent_id( $this->id ) ) && has_post_thumbnail( $parent_id ) ) {
1561
			$image = get_the_post_thumbnail( $parent_id, $size, $attr );
1562
		} elseif ( $placeholder ) {
1563
			$image = wc_placeholder_img( $size );
1564
		} else {
1565
			$image = '';