Code Duplication    Length = 10-10 lines in 2 locations

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

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

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

@@ 535-544 (lines=10) @@
532
		return $return;
533
	}
534
535
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
536
		$blog_id = $this->api->get_blog_id( $blog_id );
537
		if ( !$blog_id || is_wp_error( $blog_id ) ) {
538
			return $blog_id;
539
		}
540
		switch_to_blog( $blog_id );
541
		$post = $this->get_post_by( 'ID', $post_id, $context );
542
		restore_current_blog();
543
		return $post;
544
	}
545
546
	/**
547
	 * Supporting featured media in post endpoints. Currently on for wpcom blogs