Code Duplication    Length = 9-9 lines in 2 locations

json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location

@@ 317-325 (lines=9) @@
314
				$response[$key] = null;
315
316
				$thumb_id = get_post_thumbnail_id( $post->ID );
317
				if ( ! empty( $thumb_id ) ) {
318
					$attachment = get_post( $thumb_id );
319
					if ( ! empty( $attachment ) )
320
						$featured_image_object = $this->get_attachment( $attachment );
321
322
					if ( ! empty( $featured_image_object ) ) {
323
						$response[$key] = (object) $featured_image_object;
324
					}
325
				}
326
				break;
327
			case 'format' :
328
				$response[$key] = (string) get_post_format( $post->ID );

sal/class.json-api-post-base.php 1 location

@@ 265-273 (lines=9) @@
262
263
		$thumb_id = get_post_thumbnail_id( $this->post->ID );
264
265
		if ( ! empty( $thumb_id ) ) {
266
			$attachment = get_post( $thumb_id );
267
			if ( ! empty( $attachment ) )
268
				$featured_image_object = $this->get_attachment( $attachment );
269
270
			if ( ! empty( $featured_image_object ) ) {
271
				$thumb = (object) $featured_image_object;
272
			}
273
		}
274
275
		return $thumb;
276
	}