@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | if(!isset($_GET['refresh_tours'])){ |
253 | 253 | echo ' - <small><a href="'.admin_url('admin.php').'?page='.$this->plugin_slug.'&tab=tour&refresh_tours=true">'.esc_attr('Refresh','wetu-importer').'</a></small>'; |
254 | 254 | } |
255 | - }else{ |
|
255 | + } else{ |
|
256 | 256 | echo '<span style="color:red;">'.wp_kses_post($result).'</span>'; |
257 | 257 | } |
258 | - }else{ |
|
258 | + } else{ |
|
259 | 259 | 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>'; |
260 | 260 | } |
261 | 261 | echo '</h3></div>'; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | if(isset($tours['error'])){ |
272 | 272 | return $tours['error']; |
273 | - }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
273 | + } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
274 | 274 | set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2); |
275 | 275 | return true; |
276 | 276 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | if(isset($_POST['keyword'] )) { |
319 | 319 | $keyphrases = $_POST['keyword']; |
320 | - }else{ |
|
320 | + } else{ |
|
321 | 321 | $keyphrases = array(0); |
322 | 322 | } |
323 | 323 | |
@@ -369,16 +369,16 @@ discard block |
||
369 | 369 | |
370 | 370 | if(0 !== $row['post_id']){ |
371 | 371 | continue; |
372 | - }else{ |
|
372 | + } else{ |
|
373 | 373 | $searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row); |
374 | 374 | } |
375 | 375 | |
376 | 376 | |
377 | - }else{ |
|
377 | + } else{ |
|
378 | 378 | |
379 | 379 | if(0 === $row['post_id']){ |
380 | 380 | continue; |
381 | - }else{ |
|
381 | + } else{ |
|
382 | 382 | $current_status = get_post_status($row['post_id']); |
383 | 383 | if($current_status !== $post_status){ |
384 | 384 | continue; |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | } |
391 | 391 | |
392 | - }else{ |
|
392 | + } else{ |
|
393 | 393 | //Search through each keyword. |
394 | 394 | foreach($keyphrases as $keyphrase){ |
395 | 395 | |
@@ -458,14 +458,14 @@ discard block |
||
458 | 458 | $wetu_id = $_POST['wetu_id']; |
459 | 459 | if(isset($_POST['post_id'])){ |
460 | 460 | $post_id = $_POST['post_id']; |
461 | - }else{ |
|
461 | + } else{ |
|
462 | 462 | $post_id = 0; |
463 | 463 | } |
464 | 464 | |
465 | 465 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
466 | 466 | $content = $_POST['content']; |
467 | 467 | add_option('wetu_importer_tour_settings',$content); |
468 | - }else{ |
|
468 | + } else{ |
|
469 | 469 | delete_option('wetu_importer_tour_settings'); |
470 | 470 | $content = false; |
471 | 471 | } |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | if(isset($data['description'])){ |
507 | 507 | $data_post_content = $data['description']; |
508 | - }elseif(isset($data['summary'])){ |
|
508 | + } elseif(isset($data['summary'])){ |
|
509 | 509 | $data_post_content = $data['summary']; |
510 | 510 | } |
511 | 511 | $post['post_content'] = $data_post_content; |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $id = wp_update_post($post); |
519 | 519 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
520 | 520 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date); |
521 | - }else{ |
|
521 | + } else{ |
|
522 | 522 | |
523 | 523 | //Set the name |
524 | 524 | if(isset($data['name'])){ |
@@ -631,42 +631,42 @@ discard block |
||
631 | 631 | //Description |
632 | 632 | if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes'])){ |
633 | 633 | $current_day['description'] = $day['notes']; |
634 | - }else{ |
|
634 | + } else{ |
|
635 | 635 | $current_day['description'] = ''; |
636 | 636 | } |
637 | 637 | |
638 | 638 | //Itinerary Gallery |
639 | 639 | if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){ |
640 | 640 | $current_day['featured_image'] = ''; |
641 | - }else{ |
|
641 | + } else{ |
|
642 | 642 | $current_day['featured_image'] = ''; |
643 | 643 | } |
644 | 644 | |
645 | 645 | //Accommodation |
646 | 646 | if(false !== $current_accommodation){ |
647 | 647 | $current_day['accommodation_to_tour'] = array($current_accommodation); |
648 | - }else{ |
|
648 | + } else{ |
|
649 | 649 | $current_day['accommodation_to_tour'] = array(); |
650 | 650 | } |
651 | 651 | |
652 | 652 | //Destination |
653 | 653 | if(false !== $current_destination){ |
654 | 654 | $current_day['destination_to_tour'] = array($current_destination); |
655 | - }else{ |
|
655 | + } else{ |
|
656 | 656 | $current_day['destination_to_tour'] = array(); |
657 | 657 | } |
658 | 658 | |
659 | 659 | //Included |
660 | 660 | if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){ |
661 | 661 | $current_day['included'] = $day['included']; |
662 | - }else{ |
|
662 | + } else{ |
|
663 | 663 | $current_day['included'] = ''; |
664 | 664 | } |
665 | 665 | |
666 | 666 | //Excluded |
667 | 667 | if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){ |
668 | 668 | $current_day['excluded'] = $day['excluded']; |
669 | - }else{ |
|
669 | + } else{ |
|
670 | 670 | $current_day['excluded'] = ''; |
671 | 671 | } |
672 | 672 | |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | $day_counter++; |
675 | 675 | } |
676 | 676 | |
677 | - }else{ |
|
677 | + } else{ |
|
678 | 678 | $day_counter = $day_counter + (int)$leg['nights']; |
679 | 679 | } |
680 | 680 | |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | |
787 | 787 | if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){ |
788 | 788 | $ac_id = $this->current_accommodation[$day['content_entity_id']]; |
789 | - }else{ |
|
789 | + } else{ |
|
790 | 790 | $ac_id = wp_insert_post(array( |
791 | 791 | 'post_type' => 'accommodation', |
792 | 792 | 'post_status' => 'draft', |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | $this->set_country($country_wetu_id, $id); |
854 | 854 | } |
855 | 855 | |
856 | - }else { |
|
856 | + } else { |
|
857 | 857 | |
858 | 858 | $destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']); |
859 | 859 |