Code Duplication    Length = 10-12 lines in 3 locations

classes/class-accommodation.php 1 location

@@ 545-556 (lines=12) @@
542
	        $content_used_general_description = false;
543
544
	        //Set the post_content
545
	        if(false !== $importable_content && in_array('description',$importable_content)){
546
		        if(isset($data[0]['content']['extended_description']))
547
		        {
548
		            $data_post_content = $data[0]['content']['extended_description'];
549
		        }elseif(isset($data[0]['content']['general_description'])){
550
		            $data_post_content = $data[0]['content']['general_description'];
551
		            $content_used_general_description = true;
552
		        }elseif(isset($data[0]['content']['teaser_description'])){
553
		        	$data_post_content = $data[0]['content']['teaser_description'];
554
		        }
555
	        	$post['post_content'] = wp_strip_all_tags($data_post_content);
556
	        }
557
558
	        //set the post_excerpt
559
	        if(false !== $importable_content && in_array('excerpt',$importable_content)){

classes/class-destination.php 2 locations

@@ 450-461 (lines=12) @@
447
	        $content_used_general_description = false;
448
449
	        //Set the post_content
450
	        if(false !== $importable_content && in_array('description',$importable_content)){
451
		        if(isset($data[0]['content']['extended_description']))
452
		        {
453
		            $data_post_content = $data[0]['content']['extended_description'];
454
		        }elseif(isset($data[0]['content']['general_description'])){
455
		            $data_post_content = $data[0]['content']['general_description'];
456
		            $content_used_general_description = true;
457
		        }elseif(isset($data[0]['content']['teaser_description'])){
458
		        	$data_post_content = $data[0]['content']['teaser_description'];
459
		        }
460
	        	$post['post_content'] = wp_strip_all_tags($data_post_content);
461
	        }
462
463
	        //set the post_excerpt
464
	        if(false !== $importable_content && in_array('excerpt',$importable_content)){
@@ 464-473 (lines=10) @@
461
	        }
462
463
	        //set the post_excerpt
464
	        if(false !== $importable_content && in_array('excerpt',$importable_content)){
465
		        if(isset($data[0]['content']['teaser_description'])){
466
		        	$data_post_excerpt = $data[0]['content']['teaser_description'];
467
		        }elseif(isset($data[0]['content']['extended_description'])){
468
					$data_post_excerpt = $data[0]['content']['extended_description'];
469
				}elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){
470
		            $data_post_excerpt = $data[0]['content']['general_description'];
471
		        }	   
472
		        $post['post_excerpt'] = $data_post_excerpt;     	
473
	        }
474
475
	        if(false !== $id && '0' !== $id){
476
	        	$post['ID'] = $id;