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

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