Code Duplication    Length = 10-10 lines in 2 locations

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

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

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

@@ 316-325 (lines=10) @@
313
	}
314
	
315
	// TODO: factor this out
316
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
317
		$blog_id = $this->api->get_blog_id( $blog_id );
318
		if ( !$blog_id || is_wp_error( $blog_id ) ) {
319
			return $blog_id;
320
		}
321
		switch_to_blog( $blog_id );
322
		$post = $this->get_post_by( 'ID', $post_id, $context );
323
		restore_current_blog();
324
		return $post;
325
	}
326
327
	function win8_gallery_shortcode( $attr ) {
328
		global $post;