Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 518-527 (lines=10) @@
515
		return $return;
516
	}
517
518
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
519
		$blog_id = $this->api->get_blog_id( $blog_id );
520
		if ( !$blog_id || is_wp_error( $blog_id ) ) {
521
			return $blog_id;
522
		}
523
		switch_to_blog( $blog_id );
524
		$post = $this->get_post_by( 'ID', $post_id, $context );
525
		restore_current_blog();
526
		return $post;
527
	}
528
529
	/**
530
	 * Supporting featured media in post endpoints. Currently on for wpcom blogs

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

@@ 269-278 (lines=10) @@
266
	}
267
268
	// TODO: factor this out
269
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
270
		$blog_id = $this->api->get_blog_id( $blog_id );
271
		if ( !$blog_id || is_wp_error( $blog_id ) ) {
272
			return $blog_id;
273
		}
274
		switch_to_blog( $blog_id );
275
		$post = $this->get_post_by( 'ID', $post_id, $context );
276
		restore_current_blog();
277
		return $post;
278
	}
279
280
	function win8_gallery_shortcode( $attr ) {
281
		global $post;