Code Duplication    Length = 9-9 lines in 2 locations

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
	}

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 );