Completed
Push — master ( 8a71c5...21aee9 )
by Warwick
02:52
created
classes/class-tours.php 1 patch
Braces   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 			    if(!isset($_GET['refresh_tours'])){
254 254
 			        echo ' - <small><a href="'.admin_url('admin.php').'?page='.$this->plugin_slug.'&tab=tour&refresh_tours=true">'.esc_attr('Refresh','wetu-importer').'</a></small>';
255 255
                 }
256
-            }else{
256
+            } else{
257 257
 			    echo '<span style="color:red;">'.wp_kses_post($result).'</span>';
258 258
             }
259
-		}else{
259
+		} else{
260 260
 			echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span> - <small><a href="'.admin_url('admin.php').'?page='.$this->plugin_slug.'&tab=tour&refresh_tours=true">'.esc_attr('Refresh','wetu-importer').'</a></small>';
261 261
         }
262 262
 		echo '</h3></div>';
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 		if(isset($tours['error'])){
273 273
 		    return $tours['error'];
274
-        }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) {
274
+        } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) {
275 275
 			set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2);
276 276
 			return true;
277 277
 		}
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 				if(isset($_POST['keyword'] )) {
320 320
 					$keyphrases = $_POST['keyword'];
321
-				}else{
321
+				} else{
322 322
 					$keyphrases = array(0);
323 323
                 }
324 324
 
@@ -370,16 +370,16 @@  discard block
 block discarded – undo
370 370
 
371 371
 								if(0 !== $row['post_id']){
372 372
 								    continue;
373
-								}else{
373
+								} else{
374 374
 									$searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row);
375 375
                                 }
376 376
 
377 377
 
378
-                            }else{
378
+                            } else{
379 379
 
380 380
 								if(0 === $row['post_id']){
381 381
 									continue;
382
-								}else{
382
+								} else{
383 383
 									$current_status = get_post_status($row['post_id']);
384 384
 									if($current_status !== $post_status){
385 385
 									    continue;
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 
391 391
                             }
392 392
 
393
-                        }else{
393
+                        } else{
394 394
 							//Search through each keyword.
395 395
 							foreach($keyphrases as $keyphrase){
396 396
 
@@ -459,14 +459,14 @@  discard block
 block discarded – undo
459 459
 			$wetu_id = $_POST['wetu_id'];
460 460
 			if(isset($_POST['post_id'])){
461 461
 				$post_id = $_POST['post_id'];	
462
-			}else{
462
+			} else{
463 463
 				$post_id = 0;
464 464
 			}
465 465
 
466 466
 			if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){
467 467
 				$content = $_POST['content'];
468 468
 				add_option('wetu_importer_tour_settings',$content);
469
-			}else{
469
+			} else{
470 470
 				delete_option('wetu_importer_tour_settings');
471 471
 				$content = false;
472 472
 			}
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 
508 508
             if(isset($data['description'])){
509 509
                 $data_post_content = $data['description'];
510
-            }elseif(isset($data['summary'])){
510
+            } elseif(isset($data['summary'])){
511 511
                 $data_post_content = $data['summary'];
512 512
             }
513 513
             $post['post_content'] = $data_post_content;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             $id = wp_update_post($post);
521 521
             $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true);
522 522
             update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date);
523
-        }else{
523
+        } else{
524 524
 
525 525
             //Set the name
526 526
             if(isset($data['name'])){
@@ -633,42 +633,42 @@  discard block
 block discarded – undo
633 633
 						//Description
634 634
 						if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes'])){
635 635
 							$current_day['description'] = $day['notes'];
636
-						}else{
636
+						} else{
637 637
 							$current_day['description'] = '';
638 638
 						}
639 639
 
640 640
 						//Itinerary Gallery
641 641
 						if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){
642 642
 							$current_day['featured_image'] = '';
643
-						}else{
643
+						} else{
644 644
 							$current_day['featured_image'] = '';
645 645
 						}
646 646
 
647 647
 						//Accommodation
648 648
 						if(false !== $current_accommodation){
649 649
 							$current_day['accommodation_to_tour'] = array($current_accommodation);
650
-						}else{
650
+						} else{
651 651
 							$current_day['accommodation_to_tour'] = array();
652 652
 						}
653 653
 
654 654
 						//Destination
655 655
 						if(false !== $current_destination){
656 656
 							$current_day['destination_to_tour'] = array($current_destination);
657
-						}else{
657
+						} else{
658 658
 							$current_day['destination_to_tour'] = array();
659 659
 						}
660 660
 
661 661
 						//Included
662 662
 						if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){
663 663
 							$current_day['included'] = $day['included'];
664
-						}else{
664
+						} else{
665 665
 							$current_day['included'] = '';
666 666
 						}
667 667
 
668 668
 						//Excluded
669 669
 						if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){
670 670
 							$current_day['excluded'] = $day['excluded'];
671
-						}else{
671
+						} else{
672 672
 							$current_day['excluded'] = '';
673 673
 						}
674 674
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 						$day_counter++;
677 677
 					}
678 678
 
679
-				}else{
679
+				} else{
680 680
 					$day_counter = $day_counter + (int)$leg['nights'];
681 681
 				}
682 682
 
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 
788 788
 			if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){
789 789
                 $ac_id = $this->current_accommodation[$day['content_entity_id']];
790
-			}else{
790
+			} else{
791 791
 				$ac_id = wp_insert_post(array(
792 792
                     'post_type' => 'accommodation',
793 793
                     'post_status' => 'draft',
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 					$country_id = $this->set_country($country_wetu_id, $id);
856 856
                 }
857 857
 
858
-			}else {
858
+			} else {
859 859
 
860 860
 				$destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']);
861 861
 
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 				if(0 !== $country_id && false !== $country_id){
905 905
                     $this->relation_meta[$dest_id] = $country_id;
906 906
 					$this->relation_meta[$country_id] = 0;
907
-                }else{
907
+                } else{
908 908
 					$this->relation_meta[$dest_id] = 0;
909 909
                 }
910 910
 			}
Please login to merge, or discard this patch.