@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -253,10 +253,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | if(isset($accommodation['error'])){ |
| 318 | 318 | return $accommodation['error']; |
| 319 | - }elseif (isset($accommodation) && !empty($accommodation)) { |
|
| 319 | + } elseif (isset($accommodation) && !empty($accommodation)) { |
|
| 320 | 320 | set_transient('lsx_ti_accommodation',$accommodation,60*60*2); |
| 321 | 321 | return true; |
| 322 | 322 | } |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | |
| 363 | 363 | if(isset($_POST['keyword'] )) { |
| 364 | 364 | $keyphrases = $_POST['keyword']; |
| 365 | - }else{ |
|
| 365 | + } else{ |
|
| 366 | 366 | $keyphrases = array(0); |
| 367 | 367 | } |
| 368 | 368 | |
@@ -407,16 +407,16 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | if(0 !== $row['post_id']){ |
| 409 | 409 | continue; |
| 410 | - }else{ |
|
| 410 | + } else{ |
|
| 411 | 411 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | |
| 415 | - }else{ |
|
| 415 | + } else{ |
|
| 416 | 416 | |
| 417 | 417 | if(0 === $row['post_id']){ |
| 418 | 418 | continue; |
| 419 | - }else{ |
|
| 419 | + } else{ |
|
| 420 | 420 | $current_status = get_post_status($row['post_id']); |
| 421 | 421 | if($current_status !== $post_status){ |
| 422 | 422 | continue; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | - }else{ |
|
| 429 | + } else{ |
|
| 430 | 430 | //Search through each keyword. |
| 431 | 431 | foreach($keyphrases as $keyphrase){ |
| 432 | 432 | |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | } |
| 469 | 469 | if(false !== $found && $needle_count === count($found)){ |
| 470 | 470 | return true; |
| 471 | - }else{ |
|
| 471 | + } else{ |
|
| 472 | 472 | return false; |
| 473 | 473 | } |
| 474 | 474 | } |
@@ -514,26 +514,26 @@ discard block |
||
| 514 | 514 | $wetu_id = $_POST['wetu_id']; |
| 515 | 515 | if(isset($_POST['post_id'])){ |
| 516 | 516 | $post_id = $_POST['post_id']; |
| 517 | - }else{ |
|
| 517 | + } else{ |
|
| 518 | 518 | $post_id = 0; |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | if(isset($_POST['team_members'])){ |
| 522 | 522 | $team_members = $_POST['team_members']; |
| 523 | - }else{ |
|
| 523 | + } else{ |
|
| 524 | 524 | $team_members = false; |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | if(isset($_POST['safari_brands'])){ |
| 528 | 528 | $safari_brands = $_POST['safari_brands']; |
| 529 | - }else{ |
|
| 529 | + } else{ |
|
| 530 | 530 | $safari_brands = false; |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
| 534 | 534 | $content = $_POST['content']; |
| 535 | 535 | add_option('wetu_importer_accommodation_settings',$content); |
| 536 | - }else{ |
|
| 536 | + } else{ |
|
| 537 | 537 | delete_option('wetu_importer_accommodation_settings'); |
| 538 | 538 | $content = false; |
| 539 | 539 | } |
@@ -579,10 +579,10 @@ discard block |
||
| 579 | 579 | if(isset($data[0]['content']['extended_description'])) |
| 580 | 580 | { |
| 581 | 581 | $data_post_content = $data[0]['content']['extended_description']; |
| 582 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
| 582 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
| 583 | 583 | $data_post_content = $data[0]['content']['general_description']; |
| 584 | 584 | $content_used_general_description = true; |
| 585 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
| 585 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
| 586 | 586 | $data_post_content = $data[0]['content']['teaser_description']; |
| 587 | 587 | } |
| 588 | 588 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
| 593 | 593 | if(isset($data[0]['content']['teaser_description'])){ |
| 594 | 594 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
| 595 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
| 595 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
| 596 | 596 | $data_post_excerpt = $data[0]['content']['general_description']; |
| 597 | 597 | } |
| 598 | 598 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | $id = wp_update_post($post); |
| 609 | 609 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
| 610 | 610 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
| 611 | - }else{ |
|
| 611 | + } else{ |
|
| 612 | 612 | |
| 613 | 613 | //Set the name |
| 614 | 614 | 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 | |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | if(false !== $id && '0' !== $id){ |
| 777 | 777 | $prev = get_post_meta($id,'location',true); |
| 778 | 778 | update_post_meta($id,'location',$location_data,$prev); |
| 779 | - }else{ |
|
| 779 | + } else{ |
|
| 780 | 780 | add_post_meta($id,'location',$location_data,true); |
| 781 | 781 | } |
| 782 | 782 | } |
@@ -826,10 +826,8 @@ discard block |
||
| 826 | 826 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
| 827 | 827 | { |
| 828 | 828 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
| 829 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 830 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
| 831 | - } |
|
| 832 | - else |
|
| 829 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
| 830 | + } else |
|
| 833 | 831 | { |
| 834 | 832 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
| 835 | 833 | } |
@@ -888,14 +886,14 @@ discard block |
||
| 888 | 886 | |
| 889 | 887 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
| 890 | 888 | $room_count = $data[0]['features']['rooms']; |
| 891 | - }else{ |
|
| 889 | + } else{ |
|
| 892 | 890 | $room_count = count($data[0]['rooms']); |
| 893 | 891 | } |
| 894 | 892 | |
| 895 | 893 | if(false !== $id && '0' !== $id){ |
| 896 | 894 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
| 897 | 895 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
| 898 | - }else{ |
|
| 896 | + } else{ |
|
| 899 | 897 | add_post_meta($id,'number_of_rooms',$room_count,true); |
| 900 | 898 | } |
| 901 | 899 | } |
@@ -908,7 +906,7 @@ discard block |
||
| 908 | 906 | |
| 909 | 907 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
| 910 | 908 | $rating_type = $data[0]['features']['star_authority']; |
| 911 | - }else{ |
|
| 909 | + } else{ |
|
| 912 | 910 | $rating_type = 'Unspecified2'; |
| 913 | 911 | } |
| 914 | 912 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -1039,10 +1037,8 @@ discard block |
||
| 1039 | 1037 | { |
| 1040 | 1038 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
| 1041 | 1039 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
| 1042 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 1043 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
| 1044 | - } |
|
| 1045 | - else |
|
| 1040 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
| 1041 | + } else |
|
| 1046 | 1042 | { |
| 1047 | 1043 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
| 1048 | 1044 | } |
@@ -1203,8 +1199,7 @@ discard block |
||
| 1203 | 1199 | if ( !empty( $filename) && " " != $filename ) |
| 1204 | 1200 | { |
| 1205 | 1201 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
| 1206 | - } |
|
| 1207 | - else |
|
| 1202 | + } else |
|
| 1208 | 1203 | { |
| 1209 | 1204 | $file_array['name'] = $url_filename; // just use original URL filename |
| 1210 | 1205 | } |