@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | foreach($accommodation as $row_key => $row){ |
94 | 94 | if(stripos(ltrim(rtrim($row->name)), $post->post_title) !== false){ |
95 | 95 | $identifier = $row->id; |
96 | - }else{ |
|
96 | + } else{ |
|
97 | 97 | continue; |
98 | 98 | } |
99 | 99 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | //remove the extra accommodation |
197 | 197 | if(null !== $current_accommodation && !empty($current_accommodation)){ |
198 | 198 | $all_accommodation = array_diff($this->format_array($all_accommodation,'ID'), $this->format_array($current_accommodation,'post_id')); |
199 | - }elseif(null !== $current_accommodation && empty($current_accommodation)){ |
|
199 | + } elseif(null !== $current_accommodation && empty($current_accommodation)){ |
|
200 | 200 | $all_accommodation = $this->format_array($current_accommodation,'post_id'); |
201 | 201 | } |
202 | 202 |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | delete_post_meta($_POST['post_id'],'image_group'); |
187 | 187 | add_post_meta($_POST['post_id'],'image_group',$new_banner_array,true); |
188 | 188 | echo true; |
189 | - }else{ |
|
189 | + } else{ |
|
190 | 190 | echo false; |
191 | 191 | } |
192 | 192 | |
193 | - }else{ |
|
193 | + } else{ |
|
194 | 194 | echo false; |
195 | 195 | } |
196 | 196 | die(); |
@@ -250,8 +250,7 @@ discard block |
||
250 | 250 | if ( !empty( $filename) && " " != $filename ) |
251 | 251 | { |
252 | 252 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
253 | - } |
|
254 | - else |
|
253 | + } else |
|
255 | 254 | { |
256 | 255 | $file_array['name'] = $url_filename; // just use original URL filename |
257 | 256 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | if(isset($accommodation['error'])){ |
317 | 317 | return $accommodation['error']; |
318 | - }elseif (isset($accommodation) && !empty($accommodation)) { |
|
318 | + } elseif (isset($accommodation) && !empty($accommodation)) { |
|
319 | 319 | set_transient('lsx_ti_accommodation',$accommodation,60*60*2); |
320 | 320 | return true; |
321 | 321 | } |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | if(isset($_POST['keyword'] )) { |
363 | 363 | $keyphrases = $_POST['keyword']; |
364 | - }else{ |
|
364 | + } else{ |
|
365 | 365 | $keyphrases = array(0); |
366 | 366 | } |
367 | 367 | |
@@ -406,16 +406,16 @@ discard block |
||
406 | 406 | |
407 | 407 | if(0 !== $row['post_id']){ |
408 | 408 | continue; |
409 | - }else{ |
|
409 | + } else{ |
|
410 | 410 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
411 | 411 | } |
412 | 412 | |
413 | 413 | |
414 | - }else{ |
|
414 | + } else{ |
|
415 | 415 | |
416 | 416 | if(0 === $row['post_id']){ |
417 | 417 | continue; |
418 | - }else{ |
|
418 | + } else{ |
|
419 | 419 | $current_status = get_post_status($row['post_id']); |
420 | 420 | if($current_status !== $post_status){ |
421 | 421 | continue; |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
426 | 426 | } |
427 | 427 | |
428 | - }else{ |
|
428 | + } else{ |
|
429 | 429 | //Search through each keyword. |
430 | 430 | foreach($keyphrases as $keyphrase){ |
431 | 431 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | } |
468 | 468 | if(false !== $found && $needle_count === count($found)){ |
469 | 469 | return true; |
470 | - }else{ |
|
470 | + } else{ |
|
471 | 471 | return false; |
472 | 472 | } |
473 | 473 | } |
@@ -513,26 +513,26 @@ discard block |
||
513 | 513 | $wetu_id = $_POST['wetu_id']; |
514 | 514 | if(isset($_POST['post_id'])){ |
515 | 515 | $post_id = $_POST['post_id']; |
516 | - }else{ |
|
516 | + } else{ |
|
517 | 517 | $post_id = 0; |
518 | 518 | } |
519 | 519 | |
520 | 520 | if(isset($_POST['team_members'])){ |
521 | 521 | $team_members = $_POST['team_members']; |
522 | - }else{ |
|
522 | + } else{ |
|
523 | 523 | $team_members = false; |
524 | 524 | } |
525 | 525 | |
526 | 526 | if(isset($_POST['safari_brands'])){ |
527 | 527 | $safari_brands = $_POST['safari_brands']; |
528 | - }else{ |
|
528 | + } else{ |
|
529 | 529 | $safari_brands = false; |
530 | 530 | } |
531 | 531 | |
532 | 532 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
533 | 533 | $content = $_POST['content']; |
534 | 534 | add_option('wetu_importer_accommodation_settings',$content); |
535 | - }else{ |
|
535 | + } else{ |
|
536 | 536 | delete_option('wetu_importer_accommodation_settings'); |
537 | 537 | $content = false; |
538 | 538 | } |
@@ -577,10 +577,10 @@ discard block |
||
577 | 577 | if(isset($data[0]['content']['extended_description'])) |
578 | 578 | { |
579 | 579 | $data_post_content = $data[0]['content']['extended_description']; |
580 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
580 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
581 | 581 | $data_post_content = $data[0]['content']['general_description']; |
582 | 582 | $content_used_general_description = true; |
583 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
583 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
584 | 584 | $data_post_content = $data[0]['content']['teaser_description']; |
585 | 585 | } |
586 | 586 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
591 | 591 | if(isset($data[0]['content']['teaser_description'])){ |
592 | 592 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
593 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
593 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
594 | 594 | $data_post_excerpt = $data[0]['content']['general_description']; |
595 | 595 | } |
596 | 596 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $id = wp_update_post($post); |
607 | 607 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
608 | 608 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
609 | - }else{ |
|
609 | + } else{ |
|
610 | 610 | |
611 | 611 | //Set the name |
612 | 612 | if(isset($data[0]['name'])){ |
@@ -738,13 +738,13 @@ discard block |
||
738 | 738 | |
739 | 739 | if(isset($data[0]['position']['driving_latitude'])){ |
740 | 740 | $latitude = $data[0]['position']['driving_latitude']; |
741 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
741 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
742 | 742 | $latitude = $data[0]['position']['latitude']; |
743 | 743 | } |
744 | 744 | |
745 | 745 | if(isset($data[0]['position']['driving_longitude'])){ |
746 | 746 | $longitude = $data[0]['position']['driving_longitude']; |
747 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
747 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
748 | 748 | $longitude = $data[0]['position']['longitude']; |
749 | 749 | } |
750 | 750 | |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | if(false !== $id && '0' !== $id){ |
778 | 778 | $prev = get_post_meta($id,'location',true); |
779 | 779 | update_post_meta($id,'location',$location_data,$prev); |
780 | - }else{ |
|
780 | + } else{ |
|
781 | 781 | add_post_meta($id,'location',$location_data,true); |
782 | 782 | } |
783 | 783 | } |
@@ -797,12 +797,10 @@ discard block |
||
797 | 797 | $term = wp_insert_term(trim($data[0]['position']['country']), 'location'); |
798 | 798 | if ( is_wp_error($term) ){ |
799 | 799 | echo $term->get_error_message(); |
800 | - } |
|
801 | - else { |
|
800 | + } else { |
|
802 | 801 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
803 | 802 | } |
804 | - } |
|
805 | - else |
|
803 | + } else |
|
806 | 804 | { |
807 | 805 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
808 | 806 | } |
@@ -815,10 +813,8 @@ discard block |
||
815 | 813 | if(!$term = term_exists(trim($data[0]['position']['destination']), 'location')) |
816 | 814 | { |
817 | 815 | $term = wp_insert_term(trim($data[0]['position']['destination']), 'location', $tax_args); |
818 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
819 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
820 | - } |
|
821 | - else |
|
816 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
817 | + } else |
|
822 | 818 | { |
823 | 819 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
824 | 820 | } |
@@ -866,10 +862,8 @@ discard block |
||
866 | 862 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
867 | 863 | { |
868 | 864 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
869 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
870 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
871 | - } |
|
872 | - else |
|
865 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
866 | + } else |
|
873 | 867 | { |
874 | 868 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
875 | 869 | } |
@@ -928,14 +922,14 @@ discard block |
||
928 | 922 | |
929 | 923 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
930 | 924 | $room_count = $data[0]['features']['rooms']; |
931 | - }else{ |
|
925 | + } else{ |
|
932 | 926 | $room_count = count($data[0]['rooms']); |
933 | 927 | } |
934 | 928 | |
935 | 929 | if(false !== $id && '0' !== $id){ |
936 | 930 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
937 | 931 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
938 | - }else{ |
|
932 | + } else{ |
|
939 | 933 | add_post_meta($id,'number_of_rooms',$room_count,true); |
940 | 934 | } |
941 | 935 | } |
@@ -948,7 +942,7 @@ discard block |
||
948 | 942 | |
949 | 943 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
950 | 944 | $rating_type = $data[0]['features']['star_authority']; |
951 | - }else{ |
|
945 | + } else{ |
|
952 | 946 | $rating_type = 'Unspecified2'; |
953 | 947 | } |
954 | 948 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -1078,10 +1072,8 @@ discard block |
||
1078 | 1072 | { |
1079 | 1073 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
1080 | 1074 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
1081 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
1082 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
1083 | - } |
|
1084 | - else |
|
1075 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
1076 | + } else |
|
1085 | 1077 | { |
1086 | 1078 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
1087 | 1079 | } |
@@ -1242,8 +1234,7 @@ discard block |
||
1242 | 1234 | if ( !empty( $filename) && " " != $filename ) |
1243 | 1235 | { |
1244 | 1236 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
1245 | - } |
|
1246 | - else |
|
1237 | + } else |
|
1247 | 1238 | { |
1248 | 1239 | $file_array['name'] = $url_filename; // just use original URL filename |
1249 | 1240 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | if(isset($_POST['keyword'] )) { |
329 | 329 | $keyphrases = $_POST['keyword']; |
330 | - }else{ |
|
330 | + } else{ |
|
331 | 331 | $keyphrases = array(0); |
332 | 332 | } |
333 | 333 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $searched_items[sanitize_title($row->name).'-'.$row->meta_value] = $this->format_row($row); |
366 | 366 | |
367 | 367 | |
368 | - }else{ |
|
368 | + } else{ |
|
369 | 369 | //Search through each keyword. |
370 | 370 | foreach($keyphrases as $keyphrase){ |
371 | 371 | |
@@ -434,13 +434,13 @@ discard block |
||
434 | 434 | $wetu_id = $_POST['wetu_id']; |
435 | 435 | if(isset($_POST['post_id'])){ |
436 | 436 | $post_id = $_POST['post_id']; |
437 | - }else{ |
|
437 | + } else{ |
|
438 | 438 | $post_id = 0; |
439 | 439 | } |
440 | 440 | |
441 | 441 | if(isset($_POST['team_members'])){ |
442 | 442 | $team_members = $_POST['team_members']; |
443 | - }else{ |
|
443 | + } else{ |
|
444 | 444 | $team_members = false; |
445 | 445 | } |
446 | 446 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $content = $_POST['content']; |
451 | 451 | delete_option('wetu_importer_destination_settings'); |
452 | 452 | add_option('wetu_importer_destination_settings',$content); |
453 | - }else{ |
|
453 | + } else{ |
|
454 | 454 | delete_option('wetu_importer_destination_settings'); |
455 | 455 | $content = false; |
456 | 456 | } |
@@ -490,10 +490,10 @@ discard block |
||
490 | 490 | if(isset($data[0]['content']['extended_description'])) |
491 | 491 | { |
492 | 492 | $data_post_content = $data[0]['content']['extended_description']; |
493 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
493 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
494 | 494 | $data_post_content = $data[0]['content']['general_description']; |
495 | 495 | $content_used_general_description = true; |
496 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
496 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
497 | 497 | $data_post_content = $data[0]['content']['teaser_description']; |
498 | 498 | } |
499 | 499 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -503,9 +503,9 @@ discard block |
||
503 | 503 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
504 | 504 | if(isset($data[0]['content']['teaser_description'])){ |
505 | 505 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
506 | - }elseif(isset($data[0]['content']['extended_description'])){ |
|
506 | + } elseif(isset($data[0]['content']['extended_description'])){ |
|
507 | 507 | $data_post_excerpt = $data[0]['content']['extended_description']; |
508 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
508 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
509 | 509 | $data_post_excerpt = $data[0]['content']['general_description']; |
510 | 510 | } |
511 | 511 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $id = wp_update_post($post); |
522 | 522 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
523 | 523 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
524 | - }else{ |
|
524 | + } else{ |
|
525 | 525 | |
526 | 526 | //Set the name |
527 | 527 | if(isset($data[0]['name'])){ |
@@ -621,13 +621,13 @@ discard block |
||
621 | 621 | |
622 | 622 | if(isset($data[0]['position']['driving_latitude'])){ |
623 | 623 | $latitude = $data[0]['position']['driving_latitude']; |
624 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
624 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
625 | 625 | $latitude = $data[0]['position']['latitude']; |
626 | 626 | } |
627 | 627 | |
628 | 628 | if(isset($data[0]['position']['driving_longitude'])){ |
629 | 629 | $longitude = $data[0]['position']['driving_longitude']; |
630 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
630 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
631 | 631 | $longitude = $data[0]['position']['longitude']; |
632 | 632 | } |
633 | 633 | |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | if(false !== $id && '0' !== $id){ |
661 | 661 | $prev = get_post_meta($id,'location',true); |
662 | 662 | update_post_meta($id,'location',$location_data,$prev); |
663 | - }else{ |
|
663 | + } else{ |
|
664 | 664 | add_post_meta($id,'location',$location_data,true); |
665 | 665 | } |
666 | 666 | } |
@@ -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 |
@@ -162,18 +162,15 @@ discard block |
||
162 | 162 | if ( is_wp_error($term) ) |
163 | 163 | { |
164 | 164 | echo $term->get_error_message(); |
165 | - } |
|
166 | - else |
|
165 | + } else |
|
167 | 166 | { |
168 | 167 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
169 | 168 | } |
170 | - } |
|
171 | - else |
|
169 | + } else |
|
172 | 170 | { |
173 | 171 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
174 | 172 | } |
175 | - } |
|
176 | - else |
|
173 | + } else |
|
177 | 174 | { |
178 | 175 | $result[]=trim($k); |
179 | 176 | } |
@@ -200,7 +197,7 @@ discard block |
||
200 | 197 | foreach($team_members->posts as $member){ ?> |
201 | 198 | <li><input class="team" <?php $this->checked($selected,$member); ?> type="checkbox" value="<?php echo $member; ?>" /> <?php echo get_the_title($member); ?></li> |
202 | 199 | <?php } |
203 | - }else{ ?> |
|
200 | + } else{ ?> |
|
204 | 201 | <li><input class="team" type="checkbox" value="0" /> <?php _e('None','wetu-importer'); ?></li> |
205 | 202 | <?php } |
206 | 203 | ?> |
@@ -221,7 +218,7 @@ discard block |
||
221 | 218 | foreach($terms as $term){ |
222 | 219 | $return .= '<li><input class="'.$taxonomy.'" '.$this->checked($selected,$term->term_id,false).' type="checkbox" value="'.$term->term_id.'" /> '.$term->name.'</li>'; |
223 | 220 | } |
224 | - }else{ |
|
221 | + } else{ |
|
225 | 222 | $return .= '<li><input type="checkbox" value="" /> '.__('None','wetu-importer').'</li>'; |
226 | 223 | } |
227 | 224 | $return .= '</ul>'; |
@@ -242,7 +239,7 @@ discard block |
||
242 | 239 | |
243 | 240 | if(false !== $id && '0' !== $id && false !== $prev && true === $unique){ |
244 | 241 | update_post_meta($id,$meta_key,$value,$prev); |
245 | - }else{ |
|
242 | + } else{ |
|
246 | 243 | add_post_meta($id,$meta_key,$value,$unique); |
247 | 244 | } |
248 | 245 | } |
@@ -329,7 +326,7 @@ discard block |
||
329 | 326 | if (in_array($needle, $haystack)) { |
330 | 327 | if(true === $wrap || 'true' === $wrap) { |
331 | 328 | $html = $type . '"' . $type . '"'; |
332 | - }else{ |
|
329 | + } else{ |
|
333 | 330 | $html = $type; |
334 | 331 | } |
335 | 332 | } |