@@ -249,10 +249,10 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | if(true === $result){ |
| 251 | 251 | echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span>'; |
| 252 | - }else{ |
|
| 252 | + } else{ |
|
| 253 | 253 | echo '<span style="color:red;">'.wp_kses_post($result).'</span>'; |
| 254 | 254 | } |
| 255 | - }else{ |
|
| 255 | + } else{ |
|
| 256 | 256 | echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span>'; |
| 257 | 257 | } |
| 258 | 258 | echo '</h3></div>'; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | if(isset($tours['error'])){ |
| 269 | 269 | return $tours['error']; |
| 270 | - }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
| 270 | + } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
| 271 | 271 | set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2); |
| 272 | 272 | return true; |
| 273 | 273 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | if(isset($_POST['keyword'] )) { |
| 316 | 316 | $keyphrases = $_POST['keyword']; |
| 317 | - }else{ |
|
| 317 | + } else{ |
|
| 318 | 318 | $keyphrases = array(0); |
| 319 | 319 | } |
| 320 | 320 | |
@@ -366,16 +366,16 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | if(0 !== $row['post_id']){ |
| 368 | 368 | continue; |
| 369 | - }else{ |
|
| 369 | + } else{ |
|
| 370 | 370 | $searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | |
| 374 | - }else{ |
|
| 374 | + } else{ |
|
| 375 | 375 | |
| 376 | 376 | if(0 === $row['post_id']){ |
| 377 | 377 | continue; |
| 378 | - }else{ |
|
| 378 | + } else{ |
|
| 379 | 379 | $current_status = get_post_status($row['post_id']); |
| 380 | 380 | if($current_status !== $post_status){ |
| 381 | 381 | continue; |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | - }else{ |
|
| 389 | + } else{ |
|
| 390 | 390 | //Search through each keyword. |
| 391 | 391 | foreach($keyphrases as $keyphrase){ |
| 392 | 392 | |
@@ -455,14 +455,14 @@ discard block |
||
| 455 | 455 | $wetu_id = $_POST['wetu_id']; |
| 456 | 456 | if(isset($_POST['post_id'])){ |
| 457 | 457 | $post_id = $_POST['post_id']; |
| 458 | - }else{ |
|
| 458 | + } else{ |
|
| 459 | 459 | $post_id = 0; |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
| 463 | 463 | $content = $_POST['content']; |
| 464 | 464 | add_option('wetu_importer_tour_settings',$content); |
| 465 | - }else{ |
|
| 465 | + } else{ |
|
| 466 | 466 | delete_option('wetu_importer_tour_settings'); |
| 467 | 467 | $content = false; |
| 468 | 468 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | if(isset($data['description'])){ |
| 504 | 504 | $data_post_content = $data['description']; |
| 505 | - }elseif(isset($data['summary'])){ |
|
| 505 | + } elseif(isset($data['summary'])){ |
|
| 506 | 506 | $data_post_content = $data['summary']; |
| 507 | 507 | } |
| 508 | 508 | $post['post_content'] = $data_post_content; |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $id = wp_update_post($post); |
| 516 | 516 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
| 517 | 517 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date); |
| 518 | - }else{ |
|
| 518 | + } else{ |
|
| 519 | 519 | |
| 520 | 520 | //Set the name |
| 521 | 521 | if(isset($data['name'])){ |
@@ -628,42 +628,42 @@ discard block |
||
| 628 | 628 | //Description |
| 629 | 629 | if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes'])){ |
| 630 | 630 | $current_day['description'] = $day['notes']; |
| 631 | - }else{ |
|
| 631 | + } else{ |
|
| 632 | 632 | $current_day['description'] = ''; |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | //Itinerary Gallery |
| 636 | 636 | if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){ |
| 637 | 637 | $current_day['featured_image'] = ''; |
| 638 | - }else{ |
|
| 638 | + } else{ |
|
| 639 | 639 | $current_day['featured_image'] = ''; |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | //Accommodation |
| 643 | 643 | if(false !== $current_accommodation){ |
| 644 | 644 | $current_day['accommodation_to_tour'] = array($current_accommodation); |
| 645 | - }else{ |
|
| 645 | + } else{ |
|
| 646 | 646 | $current_day['accommodation_to_tour'] = array(); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | //Destination |
| 650 | 650 | if(false !== $current_destination){ |
| 651 | 651 | $current_day['destination_to_tour'] = array($current_destination); |
| 652 | - }else{ |
|
| 652 | + } else{ |
|
| 653 | 653 | $current_day['destination_to_tour'] = array(); |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | //Included |
| 657 | 657 | if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){ |
| 658 | 658 | $current_day['included'] = $day['included']; |
| 659 | - }else{ |
|
| 659 | + } else{ |
|
| 660 | 660 | $current_day['included'] = ''; |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | //Excluded |
| 664 | 664 | if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){ |
| 665 | 665 | $current_day['excluded'] = $day['excluded']; |
| 666 | - }else{ |
|
| 666 | + } else{ |
|
| 667 | 667 | $current_day['excluded'] = ''; |
| 668 | 668 | } |
| 669 | 669 | |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | $day_counter++; |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | - }else{ |
|
| 674 | + } else{ |
|
| 675 | 675 | $day_counter = $day_counter + (int)$leg['nights']; |
| 676 | 676 | } |
| 677 | 677 | |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | |
| 784 | 784 | if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){ |
| 785 | 785 | $ac_id = $this->current_accommodation[$day['content_entity_id']]; |
| 786 | - }else{ |
|
| 786 | + } else{ |
|
| 787 | 787 | $ac_id = wp_insert_post(array( |
| 788 | 788 | 'post_type' => 'accommodation', |
| 789 | 789 | 'post_status' => 'draft', |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | $this->set_country($country_wetu_id, $id); |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | - }else { |
|
| 853 | + } else { |
|
| 854 | 854 | |
| 855 | 855 | $destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']); |
| 856 | 856 | |