Code Duplication    Length = 6-7 lines in 2 locations

projects/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery-item.php 1 location

@@ 43-48 (lines=6) @@
40
	public function fuzzy_image_meta() {
41
		$meta     = wp_get_attachment_metadata( $this->image->ID );
42
		$img_meta = ( ! empty( $meta['image_meta'] ) ) ? (array) $meta['image_meta'] : array();
43
		if ( ! empty( $img_meta ) ) {
44
			foreach ( $img_meta as $k => $v ) {
45
				if ( 'latitude' == $k || 'longitude' == $k ) {
46
					unset( $img_meta[ $k ] );
47
				}
48
			}
49
		}
50
51
		return $img_meta;

projects/plugins/jetpack/modules/carousel/jetpack-carousel.php 1 location

@@ 602-608 (lines=7) @@
599
		$attachment_title = wptexturize( $attachment->post_title );
600
		$attachment_desc  = wpautop( wptexturize( $attachment->post_content ) );
601
		// Not yet providing geo-data, need to "fuzzify" for privacy
602
		if ( ! empty( $img_meta ) ) {
603
			foreach ( $img_meta as $k => $v ) {
604
				if ( 'latitude' == $k || 'longitude' == $k ) {
605
					unset( $img_meta[ $k ] );
606
				}
607
			}
608
		}
609
610
		// See https://github.com/Automattic/jetpack/issues/2765
611
		if ( isset( $img_meta['keywords'] ) ) {