@@ -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 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | if(isset($accommodation['error'])){ |
239 | 239 | return $accommodation['error']; |
240 | - }elseif (isset($accommodation) && !empty($accommodation)) { |
|
240 | + } elseif (isset($accommodation) && !empty($accommodation)) { |
|
241 | 241 | set_transient('lsx_ti_accommodation',$accommodation,60*60*2); |
242 | 242 | return true; |
243 | 243 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if(isset($_POST['keyword'] )) { |
263 | 263 | $keyphrases = $_POST['keyword']; |
264 | - }else{ |
|
264 | + } else{ |
|
265 | 265 | $keyphrases = array(0); |
266 | 266 | } |
267 | 267 | |
@@ -306,15 +306,15 @@ discard block |
||
306 | 306 | |
307 | 307 | if(is_array($this->queued_imports) && in_array($row['post_id'],$this->queued_imports)){ |
308 | 308 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
309 | - }else{ |
|
309 | + } else{ |
|
310 | 310 | continue; |
311 | 311 | } |
312 | 312 | |
313 | - }else{ |
|
313 | + } else{ |
|
314 | 314 | |
315 | 315 | if(0 === $row['post_id']){ |
316 | 316 | continue; |
317 | - }else{ |
|
317 | + } else{ |
|
318 | 318 | $current_status = get_post_status($row['post_id']); |
319 | 319 | if($current_status !== $post_status){ |
320 | 320 | continue; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
325 | 325 | } |
326 | 326 | |
327 | - }else{ |
|
327 | + } else{ |
|
328 | 328 | //Search through each keyword. |
329 | 329 | foreach($keyphrases as $keyphrase){ |
330 | 330 | |
@@ -408,19 +408,19 @@ discard block |
||
408 | 408 | $wetu_id = $_POST['wetu_id']; |
409 | 409 | if(isset($_POST['post_id'])){ |
410 | 410 | $post_id = $_POST['post_id']; |
411 | - }else{ |
|
411 | + } else{ |
|
412 | 412 | $post_id = 0; |
413 | 413 | } |
414 | 414 | |
415 | 415 | if(isset($_POST['team_members'])){ |
416 | 416 | $team_members = $_POST['team_members']; |
417 | - }else{ |
|
417 | + } else{ |
|
418 | 418 | $team_members = false; |
419 | 419 | } |
420 | 420 | |
421 | 421 | if(isset($_POST['safari_brands'])){ |
422 | 422 | $safari_brands = $_POST['safari_brands']; |
423 | - }else{ |
|
423 | + } else{ |
|
424 | 424 | $safari_brands = false; |
425 | 425 | } |
426 | 426 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
429 | 429 | $content = $_POST['content']; |
430 | 430 | add_option('wetu_importer_accommodation_settings',$content); |
431 | - }else{ |
|
431 | + } else{ |
|
432 | 432 | |
433 | 433 | $content = false; |
434 | 434 | } |
@@ -467,10 +467,10 @@ discard block |
||
467 | 467 | if(isset($data[0]['content']['extended_description'])) |
468 | 468 | { |
469 | 469 | $data_post_content = $data[0]['content']['extended_description']; |
470 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
470 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
471 | 471 | $data_post_content = $data[0]['content']['general_description']; |
472 | 472 | $content_used_general_description = true; |
473 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
473 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
474 | 474 | $data_post_content = $data[0]['content']['teaser_description']; |
475 | 475 | } |
476 | 476 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
481 | 481 | if(isset($data[0]['content']['teaser_description'])){ |
482 | 482 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
483 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
483 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
484 | 484 | $data_post_excerpt = $data[0]['content']['general_description']; |
485 | 485 | } |
486 | 486 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | $id = wp_update_post($post); |
497 | 497 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
498 | 498 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
499 | - }else{ |
|
499 | + } else{ |
|
500 | 500 | |
501 | 501 | //Set the name |
502 | 502 | if(isset($data[0]['name'])){ |
@@ -660,10 +660,8 @@ discard block |
||
660 | 660 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
661 | 661 | { |
662 | 662 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
663 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
664 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
665 | - } |
|
666 | - else |
|
663 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
664 | + } else |
|
667 | 665 | { |
668 | 666 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
669 | 667 | } |
@@ -722,14 +720,14 @@ discard block |
||
722 | 720 | |
723 | 721 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
724 | 722 | $room_count = $data[0]['features']['rooms']; |
725 | - }else{ |
|
723 | + } else{ |
|
726 | 724 | $room_count = count($data[0]['rooms']); |
727 | 725 | } |
728 | 726 | |
729 | 727 | if(false !== $id && '0' !== $id){ |
730 | 728 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
731 | 729 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
732 | - }else{ |
|
730 | + } else{ |
|
733 | 731 | add_post_meta($id,'number_of_rooms',$room_count,true); |
734 | 732 | } |
735 | 733 | } |
@@ -742,7 +740,7 @@ discard block |
||
742 | 740 | |
743 | 741 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
744 | 742 | $rating_type = $data[0]['features']['star_authority']; |
745 | - }else{ |
|
743 | + } else{ |
|
746 | 744 | $rating_type = 'Unspecified2'; |
747 | 745 | } |
748 | 746 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -345,10 +345,10 @@ |
||
345 | 345 | if('import' === $post_status) { |
346 | 346 | if(is_array($this->queued_imports) && in_array($row->post_id,$this->queued_imports)){ |
347 | 347 | $searched_items[sanitize_title($row->name) . '-' . $row->meta_value] = $this->format_row($row); |
348 | - }else{ |
|
348 | + } else{ |
|
349 | 349 | continue; |
350 | 350 | } |
351 | - }else if (false !== $post_status) { |
|
351 | + } else if (false !== $post_status) { |
|
352 | 352 | |
353 | 353 | $current_status = get_post_status($row->post_id); |
354 | 354 | if ($current_status !== $post_status) { |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | if(true === $result){ |
257 | 257 | echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span>'; |
258 | 258 | echo ' - <small><a href="#">'.esc_attr('Refresh','wetu-importer').'</a></small>'; |
259 | - }else{ |
|
259 | + } else{ |
|
260 | 260 | echo '<span style="color:red;">'.wp_kses_post($result).'</span>'; |
261 | 261 | } |
262 | - }else{ |
|
262 | + } else{ |
|
263 | 263 | echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span> - <small><a href="#">'.esc_attr('Refresh','wetu-importer').'</a></small>'; |
264 | 264 | } |
265 | 265 | echo '</h3>'; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | if(isset($tours['error'])){ |
324 | 324 | return $tours['error']; |
325 | - }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
325 | + } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
326 | 326 | set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2); |
327 | 327 | return true; |
328 | 328 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | if(isset($_POST['keyword'] )) { |
373 | 373 | $keyphrases = $_POST['keyword']; |
374 | - }else{ |
|
374 | + } else{ |
|
375 | 375 | $keyphrases = array(0); |
376 | 376 | } |
377 | 377 | |
@@ -423,16 +423,16 @@ discard block |
||
423 | 423 | |
424 | 424 | if(0 !== $row['post_id']){ |
425 | 425 | continue; |
426 | - }else{ |
|
426 | + } else{ |
|
427 | 427 | $searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row); |
428 | 428 | } |
429 | 429 | |
430 | 430 | |
431 | - }else{ |
|
431 | + } else{ |
|
432 | 432 | |
433 | 433 | if(0 === $row['post_id']){ |
434 | 434 | continue; |
435 | - }else{ |
|
435 | + } else{ |
|
436 | 436 | $current_status = get_post_status($row['post_id']); |
437 | 437 | if($current_status !== $post_status){ |
438 | 438 | continue; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | } |
445 | 445 | |
446 | - }else{ |
|
446 | + } else{ |
|
447 | 447 | //Search through each keyword. |
448 | 448 | foreach($keyphrases as $keyphrase){ |
449 | 449 | |
@@ -513,7 +513,7 @@ 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 | |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
522 | 522 | $content = $_POST['content']; |
523 | 523 | add_option('wetu_importer_tour_settings',$content); |
524 | - }else{ |
|
524 | + } else{ |
|
525 | 525 | $content = false; |
526 | 526 | } |
527 | 527 | |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | |
562 | 562 | if(isset($data['description'])){ |
563 | 563 | $data_post_content = $data['description']; |
564 | - }elseif(isset($data['summary'])){ |
|
564 | + } elseif(isset($data['summary'])){ |
|
565 | 565 | $data_post_content = $data['summary']; |
566 | 566 | } |
567 | 567 | $post['post_content'] = $data_post_content; |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | $id = wp_update_post($post); |
575 | 575 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
576 | 576 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date); |
577 | - }else{ |
|
577 | + } else{ |
|
578 | 578 | |
579 | 579 | //Set the name |
580 | 580 | if(isset($data['name'])){ |
@@ -665,42 +665,42 @@ discard block |
||
665 | 665 | //Description |
666 | 666 | if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes'])){ |
667 | 667 | $current_day['description'] = $day['notes']; |
668 | - }else{ |
|
668 | + } else{ |
|
669 | 669 | $current_day['description'] = ''; |
670 | 670 | } |
671 | 671 | |
672 | 672 | //Itinerary Gallery |
673 | 673 | if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){ |
674 | 674 | $current_day['featured_image'] = ''; |
675 | - }else{ |
|
675 | + } else{ |
|
676 | 676 | $current_day['featured_image'] = ''; |
677 | 677 | } |
678 | 678 | |
679 | 679 | //Accommodation |
680 | 680 | if(false !== $current_accommodation){ |
681 | 681 | $current_day['accommodation_to_tour'] = array($current_accommodation); |
682 | - }else{ |
|
682 | + } else{ |
|
683 | 683 | $current_day['accommodation_to_tour'] = array(); |
684 | 684 | } |
685 | 685 | |
686 | 686 | //Destination |
687 | 687 | if(false !== $current_destination){ |
688 | 688 | $current_day['destination_to_tour'] = array($current_destination); |
689 | - }else{ |
|
689 | + } else{ |
|
690 | 690 | $current_day['destination_to_tour'] = array(); |
691 | 691 | } |
692 | 692 | |
693 | 693 | //Included |
694 | 694 | if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){ |
695 | 695 | $current_day['included'] = $day['included']; |
696 | - }else{ |
|
696 | + } else{ |
|
697 | 697 | $current_day['included'] = ''; |
698 | 698 | } |
699 | 699 | |
700 | 700 | //Excluded |
701 | 701 | if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){ |
702 | 702 | $current_day['excluded'] = $day['excluded']; |
703 | - }else{ |
|
703 | + } else{ |
|
704 | 704 | $current_day['excluded'] = ''; |
705 | 705 | } |
706 | 706 | |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | $day_counter++; |
709 | 709 | } |
710 | 710 | |
711 | - }else{ |
|
711 | + } else{ |
|
712 | 712 | $day_counter = $day_counter + (int)$leg['nights']; |
713 | 713 | } |
714 | 714 | |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | |
822 | 822 | if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){ |
823 | 823 | $ac_id = $this->current_accommodation[$day['content_entity_id']]; |
824 | - }else{ |
|
824 | + } else{ |
|
825 | 825 | $ac_id = wp_insert_post(array( |
826 | 826 | 'post_type' => 'accommodation', |
827 | 827 | 'post_status' => 'draft', |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | $country_id = $this->set_country($country_wetu_id, $id); |
892 | 892 | } |
893 | 893 | |
894 | - }else { |
|
894 | + } else { |
|
895 | 895 | |
896 | 896 | $destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']); |
897 | 897 | |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | if(0 !== $country_id && false !== $country_id){ |
951 | 951 | $this->relation_meta[$dest_id] = $country_id; |
952 | 952 | $this->relation_meta[$country_id] = 0; |
953 | - }else{ |
|
953 | + } else{ |
|
954 | 954 | $this->relation_meta[$dest_id] = 0; |
955 | 955 | } |
956 | 956 | } |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | public function queue_item($id) { |
1058 | 1058 | if(is_array($this->import_queue) && !in_array($id,$this->import_queue)){ |
1059 | 1059 | $this->import_queue[] = $id; |
1060 | - }else{ |
|
1060 | + } else{ |
|
1061 | 1061 | $this->import_queue[] = $id; |
1062 | 1062 | } |
1063 | 1063 | } |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | if (!empty($this->queued_imports)) { |
1072 | 1072 | $saved_imports = array_merge($this->queued_imports,$this->import_queue); |
1073 | 1073 | |
1074 | - }else{ |
|
1074 | + } else{ |
|
1075 | 1075 | $saved_imports = $this->import_queue; |
1076 | 1076 | } |
1077 | 1077 | delete_option('wetu_importer_que'); |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | <?php } ?> |
401 | 401 | </ul> |
402 | 402 | <?php*/ |
403 | - }else{ |
|
403 | + } else{ |
|
404 | 404 | $this->current_importer->display_page(); |
405 | 405 | }; ?> |
406 | 406 | </div> |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | <?php if('tour'===$this->tab_slug){ ?> |
438 | 438 | | <a class="import search-toggle" href="#import"><?php esc_attr_e('WETU','wetu-importer'); ?></a> |
439 | - <?php }else if(!empty($this->queued_imports)) { ?> |
|
439 | + <?php } else if(!empty($this->queued_imports)) { ?> |
|
440 | 440 | | <a class="import search-toggle" href="#import"><?php esc_attr_e('WETU Queue','wetu-importer'); ?></a> |
441 | 441 | <?php } ?> |
442 | 442 | </p> |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | foreach($team_members->posts as $member){ ?> |
527 | 527 | <li><input class="team" <?php $this->checked($selected,$member); ?> type="checkbox" value="<?php echo $member; ?>" /> <?php echo get_the_title($member); ?></li> |
528 | 528 | <?php } |
529 | - }else{ ?> |
|
529 | + } else{ ?> |
|
530 | 530 | <li><input class="team" type="checkbox" value="0" /> <?php _e('None','wetu-importer'); ?></li> |
531 | 531 | <?php } |
532 | 532 | ?> |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | if (in_array($needle, $haystack)) { |
592 | 592 | if(true === $wrap || 'true' === $wrap) { |
593 | 593 | $html = $type . '="' . $type . '"'; |
594 | - }else{ |
|
594 | + } else{ |
|
595 | 595 | $html = $type; |
596 | 596 | } |
597 | 597 | } |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | |
644 | 644 | if(false !== $id && '0' !== $id && false !== $prev && true === $unique){ |
645 | 645 | update_post_meta($id,$meta_key,$value,$prev); |
646 | - }else{ |
|
646 | + } else{ |
|
647 | 647 | add_post_meta($id,$meta_key,$value,$unique); |
648 | 648 | } |
649 | 649 | } |
@@ -684,18 +684,15 @@ discard block |
||
684 | 684 | if ( is_wp_error($term) ) |
685 | 685 | { |
686 | 686 | echo $term->get_error_message(); |
687 | - } |
|
688 | - else |
|
687 | + } else |
|
689 | 688 | { |
690 | 689 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
691 | 690 | } |
692 | - } |
|
693 | - else |
|
691 | + } else |
|
694 | 692 | { |
695 | 693 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
696 | 694 | } |
697 | - } |
|
698 | - else |
|
695 | + } else |
|
699 | 696 | { |
700 | 697 | $result[]=trim($k); |
701 | 698 | } |
@@ -709,10 +706,8 @@ discard block |
||
709 | 706 | { |
710 | 707 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
711 | 708 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
712 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
713 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
714 | - } |
|
715 | - else |
|
709 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
710 | + } else |
|
716 | 711 | { |
717 | 712 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
718 | 713 | } |
@@ -732,7 +727,7 @@ discard block |
||
732 | 727 | foreach($terms as $term){ |
733 | 728 | $return .= '<li><input class="'.$taxonomy.'" '.$this->checked($selected,$term->term_id,false).' type="checkbox" value="'.$term->term_id.'" /> '.$term->name.'</li>'; |
734 | 729 | } |
735 | - }else{ |
|
730 | + } else{ |
|
736 | 731 | $return .= '<li><input type="checkbox" value="" /> '.__('None','wetu-importer').'</li>'; |
737 | 732 | } |
738 | 733 | $return .= '</ul>'; |
@@ -751,13 +746,13 @@ discard block |
||
751 | 746 | |
752 | 747 | if(isset($data[0]['position']['driving_latitude'])){ |
753 | 748 | $latitude = $data[0]['position']['driving_latitude']; |
754 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
749 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
755 | 750 | $latitude = $data[0]['position']['latitude']; |
756 | 751 | } |
757 | 752 | |
758 | 753 | if(isset($data[0]['position']['driving_longitude'])){ |
759 | 754 | $longitude = $data[0]['position']['driving_longitude']; |
760 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
755 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
761 | 756 | $longitude = $data[0]['position']['longitude']; |
762 | 757 | } |
763 | 758 | |
@@ -789,7 +784,7 @@ discard block |
||
789 | 784 | if(false !== $id && '0' !== $id){ |
790 | 785 | $prev = get_post_meta($id,'location',true); |
791 | 786 | update_post_meta($id,'location',$location_data,$prev); |
792 | - }else{ |
|
787 | + } else{ |
|
793 | 788 | add_post_meta($id,'location',$location_data,true); |
794 | 789 | } |
795 | 790 | } |
@@ -805,7 +800,7 @@ discard block |
||
805 | 800 | if('tour' === $this->tab_slug){ |
806 | 801 | $key = array_rand($data[0]['content']['images']); |
807 | 802 | $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
808 | - }else{ |
|
803 | + } else{ |
|
809 | 804 | $this->featured_image = $this->attach_image($data[0]['content']['images'][0],$id); |
810 | 805 | } |
811 | 806 | |
@@ -831,7 +826,7 @@ discard block |
||
831 | 826 | if('tour' === $this->tab_slug){ |
832 | 827 | $key = array_rand($data[0]['content']['images']); |
833 | 828 | $this->banner_image = $this->attach_image($data[0]['content']['images'][$key],$id,array('width'=>'1920','height'=>'600','cropping'=>'c')); |
834 | - }else{ |
|
829 | + } else{ |
|
835 | 830 | $this->banner_image = $this->attach_image($data[0]['content']['images'][1],$id,array('width'=>'1920','height'=>'600','cropping'=>'c')); |
836 | 831 | } |
837 | 832 | |
@@ -997,8 +992,7 @@ discard block |
||
997 | 992 | if ( !empty( $filename) && " " != $filename ) |
998 | 993 | { |
999 | 994 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
1000 | - } |
|
1001 | - else |
|
995 | + } else |
|
1002 | 996 | { |
1003 | 997 | $file_array['name'] = $url_filename; // just use original URL filename |
1004 | 998 | } |
@@ -1072,7 +1066,7 @@ discard block |
||
1072 | 1066 | } |
1073 | 1067 | if(false !== $found && $needle_count === count($found)){ |
1074 | 1068 | return true; |
1075 | - }else{ |
|
1069 | + } else{ |
|
1076 | 1070 | return false; |
1077 | 1071 | } |
1078 | 1072 | } |