Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 494-503 (lines=10) @@
491
		return $return;
492
	}
493
494
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
495
		$blog_id = $this->api->get_blog_id( $blog_id );
496
		if ( !$blog_id || is_wp_error( $blog_id ) ) {
497
			return $blog_id;
498
		}
499
		switch_to_blog( $blog_id );
500
		$post = $this->get_post_by( 'ID', $post_id, $context );
501
		restore_current_blog();
502
		return $post;
503
	}
504
505
	/**
506
	 * Supporting featured media in post endpoints. Currently on for wpcom blogs

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

@@ 282-291 (lines=10) @@
279
	}
280
281
	// TODO: factor this out
282
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
283
		$blog_id = $this->api->get_blog_id( $blog_id );
284
		if ( !$blog_id || is_wp_error( $blog_id ) ) {
285
			return $blog_id;
286
		}
287
		switch_to_blog( $blog_id );
288
		$post = $this->get_post_by( 'ID', $post_id, $context );
289
		restore_current_blog();
290
		return $post;
291
	}
292
293
	function win8_gallery_shortcode( $attr ) {
294
		global $post;