Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 502-521 (lines=20) @@
499
500
	// No Blog ID parameter.  No Post ID parameter.  Depends on globals.
501
	// Expects setup_postdata() to already have been run
502
	function get_the_post_content_for_display() {
503
		global $pages, $page;
504
505
		$old_pages = $pages;
506
		$old_page  = $page;
507
508
		$content = join( "\n\n", $pages );
509
		$content = preg_replace( '/<!--more(.*?)?-->/', '', $content );
510
		$pages   = array( $content );
511
		$page    = 1;
512
513
		ob_start();
514
		the_content();
515
		$return = ob_get_clean();
516
517
		$pages = $old_pages;
518
		$page  = $old_page;
519
520
		return $return;
521
	}
522
523
	function get_blog_post( $blog_id, $post_id, $context = 'display' ) {
524
		$blog_id = $this->api->get_blog_id( $blog_id );

sal/class.json-api-post-base.php 1 location

@@ 433-452 (lines=20) @@
430
431
	// No Blog ID parameter.  No Post ID parameter.  Depends on globals.
432
	// Expects setup_postdata() to already have been run
433
	function get_the_post_content_for_display() {
434
		global $pages, $page;
435
436
		$old_pages = $pages;
437
		$old_page  = $page;
438
439
		$content = join( "\n\n", $pages );
440
		$content = preg_replace( '/<!--more(.*?)?-->/', '', $content );
441
		$pages   = array( $content );
442
		$page    = 1;
443
444
		ob_start();
445
		the_content();
446
		$return = ob_get_clean();
447
448
		$pages = $old_pages;
449
		$page  = $old_page;
450
451
		return $return;
452
	}
453
454
	public function get_author() {
455
		if ( 0 == $this->post->post_author )