Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 2072-2079 (lines=8) @@
2069
		$title   = '';
2070
		$content = '';
2071
2072
		if ( $image_meta = @wp_read_image_metadata( $upload['file'] ) ) {
2073
			if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
2074
				$title = $image_meta['title'];
2075
			}
2076
			if ( trim( $image_meta['caption'] ) ) {
2077
				$content = $image_meta['caption'];
2078
			}
2079
		}
2080
2081
		$attachment = array(
2082
			'post_mime_type' => $info['type'],

includes/wc-rest-functions.php 1 location

@@ 129-136 (lines=8) @@
126
		include_once( ABSPATH . 'wp-admin/includes/image.php' );
127
	}
128
129
	if ( $image_meta = wp_read_image_metadata( $upload['file'] ) ) {
130
		if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
131
			$title = $image_meta['title'];
132
		}
133
		if ( trim( $image_meta['caption'] ) ) {
134
			$content = $image_meta['caption'];
135
		}
136
	}
137
138
	$attachment = array(
139
		'post_mime_type' => $info['type'],