Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 497-516 (lines=20) @@
494
495
	// No Blog ID parameter.  No Post ID parameter.  Depends on globals.
496
	// Expects setup_postdata() to already have been run
497
	function get_the_post_content_for_display() {
498
		global $pages, $page;
499
500
		$old_pages = $pages;
501
		$old_page  = $page;
502
503
		$content = join( "\n\n", $pages );
504
		$content = preg_replace( '/<!--more(.*?)?-->/', '', $content );
505
		$pages   = array( $content );
506
		$page    = 1;
507
508
		ob_start();
509
		the_content();
510
		$return = ob_get_clean();
511
512
		$pages = $old_pages;
513
		$page  = $old_page;
514
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 );

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

@@ 405-424 (lines=20) @@
402
403
	// No Blog ID parameter.  No Post ID parameter.  Depends on globals.
404
	// Expects setup_postdata() to already have been run
405
	function get_the_post_content_for_display() {
406
		global $pages, $page;
407
408
		$old_pages = $pages;
409
		$old_page  = $page;
410
411
		$content = join( "\n\n", $pages );
412
		$content = preg_replace( '/<!--more(.*?)?-->/', '', $content );
413
		$pages   = array( $content );
414
		$page    = 1;
415
416
		ob_start();
417
		the_content();
418
		$return = ob_get_clean();
419
420
		$pages = $old_pages;
421
		$page  = $old_page;
422
423
		return $return;
424
	}
425
426
	public function get_author() {
427
		if ( 0 == $this->post->post_author )