Code Duplication    Length = 10-12 lines in 3 locations

classes/class-accommodation.php 1 location

@@ 466-477 (lines=12) @@
463
	        $content_used_general_description = false;
464
465
	        //Set the post_content
466
	        if(false !== $importable_content && in_array('description',$importable_content)){
467
		        if(isset($data[0]['content']['extended_description']))
468
		        {
469
		            $data_post_content = $data[0]['content']['extended_description'];
470
		        }elseif(isset($data[0]['content']['general_description'])){
471
		            $data_post_content = $data[0]['content']['general_description'];
472
		            $content_used_general_description = true;
473
		        }elseif(isset($data[0]['content']['teaser_description'])){
474
		        	$data_post_content = $data[0]['content']['teaser_description'];
475
		        }
476
	        	$post['post_content'] = wp_strip_all_tags($data_post_content);
477
	        }
478
479
	        //set the post_excerpt
480
	        if(false !== $importable_content && in_array('excerpt',$importable_content)){

classes/class-destination.php 2 locations

@@ 493-504 (lines=12) @@
490
			$content_used_general_description = false;
491
492
			//Set the post_content
493
			if (false !== $importable_content && in_array('description', $importable_content)) {
494
				if (isset($data[0]['content']['extended_description'])) {
495
					$data_post_content = $data[0]['content']['extended_description'];
496
				} elseif (isset($data[0]['content']['general_description'])) {
497
					$data_post_content = $data[0]['content']['general_description'];
498
					$content_used_general_description = true;
499
				} elseif (isset($data[0]['content']['teaser_description'])) {
500
					$data_post_content = $data[0]['content']['teaser_description'];
501
				}
502
				$post['post_content'] = wp_strip_all_tags($data_post_content);
503
			}
504
505
			//set the post_excerpt
506
			if (false !== $importable_content && in_array('excerpt', $importable_content)) {
507
				if (isset($data[0]['content']['teaser_description'])) {
@@ 506-515 (lines=10) @@
503
			}
504
505
			//set the post_excerpt
506
			if (false !== $importable_content && in_array('excerpt', $importable_content)) {
507
				if (isset($data[0]['content']['teaser_description'])) {
508
					$data_post_excerpt = $data[0]['content']['teaser_description'];
509
				} elseif (isset($data[0]['content']['extended_description'])) {
510
					$data_post_excerpt = $data[0]['content']['extended_description'];
511
				} elseif (isset($data[0]['content']['general_description']) && false === $content_used_general_description) {
512
					$data_post_excerpt = $data[0]['content']['general_description'];
513
				}
514
				$post['post_excerpt'] = $data_post_excerpt;
515
			}
516
517
			if (false !== $id && '0' !== $id) {
518
				$post['ID'] = $id;