Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

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