@@ -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 |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | |
220 | 220 | if(true === $result){ |
221 | 221 | echo '<span style="color:green;">'.esc_attr('Connected','ti-tours').'</span>'; |
222 | - }else{ |
|
222 | + } else{ |
|
223 | 223 | echo '<span style="color:red;">'.wp_kses_post($result).'</span>'; |
224 | 224 | } |
225 | - }else{ |
|
225 | + } else{ |
|
226 | 226 | echo '<span style="color:green;">'.esc_attr('Connected','ti-tours').'</span>'; |
227 | 227 | } |
228 | 228 | echo '</h3></div>'; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | if(isset($tours['error'])){ |
239 | 239 | return $tours['error']; |
240 | - }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
240 | + } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) { |
|
241 | 241 | set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2); |
242 | 242 | return true; |
243 | 243 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | if(isset($_POST['keyword'] )) { |
284 | 284 | $keyphrases = $_POST['keyword']; |
285 | - }else{ |
|
285 | + } else{ |
|
286 | 286 | $keyphrases = array(0); |
287 | 287 | } |
288 | 288 | |
@@ -334,16 +334,16 @@ discard block |
||
334 | 334 | |
335 | 335 | if(0 !== $row['post_id']){ |
336 | 336 | continue; |
337 | - }else{ |
|
337 | + } else{ |
|
338 | 338 | $searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row); |
339 | 339 | } |
340 | 340 | |
341 | 341 | |
342 | - }else{ |
|
342 | + } else{ |
|
343 | 343 | |
344 | 344 | if(0 === $row['post_id']){ |
345 | 345 | continue; |
346 | - }else{ |
|
346 | + } else{ |
|
347 | 347 | $current_status = get_post_status($row['post_id']); |
348 | 348 | if($current_status !== $post_status){ |
349 | 349 | continue; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | |
355 | 355 | } |
356 | 356 | |
357 | - }else{ |
|
357 | + } else{ |
|
358 | 358 | //Search through each keyword. |
359 | 359 | foreach($keyphrases as $keyphrase){ |
360 | 360 | |
@@ -423,13 +423,13 @@ discard block |
||
423 | 423 | $wetu_id = $_POST['wetu_id']; |
424 | 424 | if(isset($_POST['post_id'])){ |
425 | 425 | $post_id = $_POST['post_id']; |
426 | - }else{ |
|
426 | + } else{ |
|
427 | 427 | $post_id = 0; |
428 | 428 | } |
429 | 429 | |
430 | 430 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
431 | 431 | $content = $_POST['content']; |
432 | - }else{ |
|
432 | + } else{ |
|
433 | 433 | $content = false; |
434 | 434 | } |
435 | 435 | |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | |
469 | 469 | if(isset($data['description'])){ |
470 | 470 | $data_post_content = $data['description']; |
471 | - }elseif(isset($data['summary'])){ |
|
471 | + } elseif(isset($data['summary'])){ |
|
472 | 472 | $data_post_content = $data['summary']; |
473 | 473 | $content_used_general_description = true; |
474 | 474 | } |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $id = wp_update_post($post); |
489 | 489 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
490 | 490 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date); |
491 | - }else{ |
|
491 | + } else{ |
|
492 | 492 | |
493 | 493 | //Set the name |
494 | 494 | if(isset($data['name'])){ |
@@ -593,28 +593,28 @@ discard block |
||
593 | 593 | //Description |
594 | 594 | if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes']) && '' !== $day['notes']){ |
595 | 595 | $current_day['description'] = strip_tags($day['notes']); |
596 | - }else{ |
|
596 | + } else{ |
|
597 | 597 | $current_day['description'] = ''; |
598 | 598 | } |
599 | 599 | |
600 | 600 | //Itinerary Gallery |
601 | 601 | if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){ |
602 | 602 | $current_day['featured_image'] = ''; |
603 | - }else{ |
|
603 | + } else{ |
|
604 | 604 | $current_day['featured_image'] = ''; |
605 | 605 | } |
606 | 606 | |
607 | 607 | //Accommodation |
608 | 608 | if(false !== $current_accommodation){ |
609 | 609 | $current_day['accommodation_to_tour'] = array($current_accommodation); |
610 | - }else{ |
|
610 | + } else{ |
|
611 | 611 | $current_day['accommodation_to_tour'] = array(); |
612 | 612 | } |
613 | 613 | |
614 | 614 | //Destination |
615 | 615 | if(false !== $current_destination){ |
616 | 616 | $current_day['destination_to_tour'] = array($current_destination); |
617 | - }else{ |
|
617 | + } else{ |
|
618 | 618 | $current_day['destination_to_tour'] = array(); |
619 | 619 | } |
620 | 620 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | $day_counter++; |
623 | 623 | } |
624 | 624 | |
625 | - }else{ |
|
625 | + } else{ |
|
626 | 626 | $day_counter = $day_counter + (int)$leg['nights']; |
627 | 627 | } |
628 | 628 | |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | |
707 | 707 | if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){ |
708 | 708 | $ac_id = $this->current_accommodation[$day['content_entity_id']]; |
709 | - }else{ |
|
709 | + } else{ |
|
710 | 710 | $ac_id = wp_insert_post(array( |
711 | 711 | 'post_type' => 'accommodation', |
712 | 712 | 'post_status' => 'draft', |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | $this->set_country($country_wetu_id, $id); |
777 | 777 | } |
778 | 778 | |
779 | - }else { |
|
779 | + } else { |
|
780 | 780 | |
781 | 781 | $destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']); |
782 | 782 |
@@ -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 | $searched_items[sanitize_title($row->name).'-'.$row->meta_value] = $this->format_row($row); |
316 | 316 | |
317 | 317 | |
318 | - }else{ |
|
318 | + } else{ |
|
319 | 319 | //Search through each keyword. |
320 | 320 | foreach($keyphrases as $keyphrase){ |
321 | 321 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | if(false !== $found && $needle_count === count($found)){ |
358 | 358 | return true; |
359 | - }else{ |
|
359 | + } else{ |
|
360 | 360 | return false; |
361 | 361 | } |
362 | 362 | } |
@@ -402,13 +402,13 @@ discard block |
||
402 | 402 | $wetu_id = $_POST['wetu_id']; |
403 | 403 | if(isset($_POST['post_id'])){ |
404 | 404 | $post_id = $_POST['post_id']; |
405 | - }else{ |
|
405 | + } else{ |
|
406 | 406 | $post_id = 0; |
407 | 407 | } |
408 | 408 | |
409 | 409 | if(isset($_POST['team_members'])){ |
410 | 410 | $team_members = $_POST['team_members']; |
411 | - }else{ |
|
411 | + } else{ |
|
412 | 412 | $team_members = false; |
413 | 413 | } |
414 | 414 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
418 | 418 | $content = $_POST['content']; |
419 | - }else{ |
|
419 | + } else{ |
|
420 | 420 | $content = false; |
421 | 421 | } |
422 | 422 | |
@@ -455,10 +455,10 @@ discard block |
||
455 | 455 | if(isset($data[0]['content']['extended_description'])) |
456 | 456 | { |
457 | 457 | $data_post_content = $data[0]['content']['extended_description']; |
458 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
458 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
459 | 459 | $data_post_content = $data[0]['content']['general_description']; |
460 | 460 | $content_used_general_description = true; |
461 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
461 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
462 | 462 | $data_post_content = $data[0]['content']['teaser_description']; |
463 | 463 | } |
464 | 464 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -468,9 +468,9 @@ discard block |
||
468 | 468 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
469 | 469 | if(isset($data[0]['content']['teaser_description'])){ |
470 | 470 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
471 | - }elseif(isset($data[0]['content']['extended_description'])){ |
|
471 | + } elseif(isset($data[0]['content']['extended_description'])){ |
|
472 | 472 | $data_post_excerpt = $data[0]['content']['extended_description']; |
473 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
473 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
474 | 474 | $data_post_excerpt = $data[0]['content']['general_description']; |
475 | 475 | } |
476 | 476 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $id = wp_update_post($post); |
487 | 487 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
488 | 488 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
489 | - }else{ |
|
489 | + } else{ |
|
490 | 490 | |
491 | 491 | //Set the name |
492 | 492 | if(isset($data[0]['name'])){ |
@@ -569,13 +569,13 @@ discard block |
||
569 | 569 | |
570 | 570 | if(isset($data[0]['position']['driving_latitude'])){ |
571 | 571 | $latitude = $data[0]['position']['driving_latitude']; |
572 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
572 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
573 | 573 | $latitude = $data[0]['position']['latitude']; |
574 | 574 | } |
575 | 575 | |
576 | 576 | if(isset($data[0]['position']['driving_longitude'])){ |
577 | 577 | $longitude = $data[0]['position']['driving_longitude']; |
578 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
578 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
579 | 579 | $longitude = $data[0]['position']['longitude']; |
580 | 580 | } |
581 | 581 | |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | if(false !== $id && '0' !== $id){ |
609 | 609 | $prev = get_post_meta($id,'location',true); |
610 | 610 | update_post_meta($id,'location',$location_data,$prev); |
611 | - }else{ |
|
611 | + } else{ |
|
612 | 612 | add_post_meta($id,'location',$location_data,true); |
613 | 613 | } |
614 | 614 | } |
@@ -161,18 +161,15 @@ discard block |
||
161 | 161 | if ( is_wp_error($term) ) |
162 | 162 | { |
163 | 163 | echo $term->get_error_message(); |
164 | - } |
|
165 | - else |
|
164 | + } else |
|
166 | 165 | { |
167 | 166 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
168 | 167 | } |
169 | - } |
|
170 | - else |
|
168 | + } else |
|
171 | 169 | { |
172 | 170 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
173 | 171 | } |
174 | - } |
|
175 | - else |
|
172 | + } else |
|
176 | 173 | { |
177 | 174 | $result[]=trim($k); |
178 | 175 | } |
@@ -199,7 +196,7 @@ discard block |
||
199 | 196 | foreach($team_members->posts as $member){ ?> |
200 | 197 | <li><input class="team" type="checkbox" value="<?php echo $member; ?>" /> <?php echo get_the_title($member); ?></li> |
201 | 198 | <?php } |
202 | - }else{ ?> |
|
199 | + } else{ ?> |
|
203 | 200 | <li><input class="team" type="checkbox" value="0" /> <?php _e('None','wetu-importer'); ?></li> |
204 | 201 | <?php } |
205 | 202 | ?> |
@@ -219,7 +216,7 @@ discard block |
||
219 | 216 | foreach($terms as $term){ |
220 | 217 | $return .= '<li><input class="'.$taxonomy.'" type="checkbox" value="'.$term->term_id.'" /> '.$term->name.'</li>'; |
221 | 218 | } |
222 | - }else{ |
|
219 | + } else{ |
|
223 | 220 | $return .= '<li><input type="checkbox" value="" /> '.__('None','wetu-importer').'</li>'; |
224 | 221 | } |
225 | 222 | $return .= '</ul>'; |
@@ -240,7 +237,7 @@ discard block |
||
240 | 237 | |
241 | 238 | if(false !== $id && '0' !== $id && false !== $prev && true === $unique){ |
242 | 239 | update_post_meta($id,$meta_key,$value,$prev); |
243 | - }else{ |
|
240 | + } else{ |
|
244 | 241 | add_post_meta($id,$meta_key,$value,$unique); |
245 | 242 | } |
246 | 243 | } |
@@ -364,16 +364,16 @@ discard block |
||
364 | 364 | |
365 | 365 | if(0 !== $row->post_id){ |
366 | 366 | continue; |
367 | - }else{ |
|
367 | + } else{ |
|
368 | 368 | $searched_items[sanitize_title($row->name).'-'.$row->id] = $this->format_row($row); |
369 | 369 | } |
370 | 370 | |
371 | 371 | |
372 | - }else{ |
|
372 | + } else{ |
|
373 | 373 | |
374 | 374 | if(0 === $row->post_id){ |
375 | 375 | continue; |
376 | - }else{ |
|
376 | + } else{ |
|
377 | 377 | $current_status = get_post_status($row->post_id); |
378 | 378 | if($current_status !== $post_status){ |
379 | 379 | continue; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $searched_items[sanitize_title($row->name).'-'.$row->id] = $this->format_row($row); |
384 | 384 | } |
385 | 385 | |
386 | - }else{ |
|
386 | + } else{ |
|
387 | 387 | //Search through each keyword. |
388 | 388 | foreach($keyphrases as $keyphrase){ |
389 | 389 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | } |
426 | 426 | if(false !== $found && $needle_count === count($found)){ |
427 | 427 | return true; |
428 | - }else{ |
|
428 | + } else{ |
|
429 | 429 | return false; |
430 | 430 | } |
431 | 431 | } |
@@ -471,25 +471,25 @@ discard block |
||
471 | 471 | $wetu_id = $_POST['wetu_id']; |
472 | 472 | if(isset($_POST['post_id'])){ |
473 | 473 | $post_id = $_POST['post_id']; |
474 | - }else{ |
|
474 | + } else{ |
|
475 | 475 | $post_id = 0; |
476 | 476 | } |
477 | 477 | |
478 | 478 | if(isset($_POST['team_members'])){ |
479 | 479 | $team_members = $_POST['team_members']; |
480 | - }else{ |
|
480 | + } else{ |
|
481 | 481 | $team_members = false; |
482 | 482 | } |
483 | 483 | |
484 | 484 | if(isset($_POST['safari_brands'])){ |
485 | 485 | $safari_brands = $_POST['safari_brands']; |
486 | - }else{ |
|
486 | + } else{ |
|
487 | 487 | $safari_brands = false; |
488 | 488 | } |
489 | 489 | |
490 | 490 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
491 | 491 | $content = $_POST['content']; |
492 | - }else{ |
|
492 | + } else{ |
|
493 | 493 | $content = false; |
494 | 494 | } |
495 | 495 | |
@@ -533,10 +533,10 @@ discard block |
||
533 | 533 | if(isset($data[0]['content']['extended_description'])) |
534 | 534 | { |
535 | 535 | $data_post_content = $data[0]['content']['extended_description']; |
536 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
536 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
537 | 537 | $data_post_content = $data[0]['content']['general_description']; |
538 | 538 | $content_used_general_description = true; |
539 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
539 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
540 | 540 | $data_post_content = $data[0]['content']['teaser_description']; |
541 | 541 | } |
542 | 542 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
547 | 547 | if(isset($data[0]['content']['teaser_description'])){ |
548 | 548 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
549 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
549 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
550 | 550 | $data_post_excerpt = $data[0]['content']['general_description']; |
551 | 551 | } |
552 | 552 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | $id = wp_update_post($post); |
562 | 562 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
563 | 563 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
564 | - }else{ |
|
564 | + } else{ |
|
565 | 565 | |
566 | 566 | //Set the name |
567 | 567 | if(isset($data[0]['name'])){ |
@@ -693,13 +693,13 @@ discard block |
||
693 | 693 | |
694 | 694 | if(isset($data[0]['position']['driving_latitude'])){ |
695 | 695 | $latitude = $data[0]['position']['driving_latitude']; |
696 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
696 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
697 | 697 | $latitude = $data[0]['position']['latitude']; |
698 | 698 | } |
699 | 699 | |
700 | 700 | if(isset($data[0]['position']['driving_longitude'])){ |
701 | 701 | $longitude = $data[0]['position']['driving_longitude']; |
702 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
702 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
703 | 703 | $longitude = $data[0]['position']['longitude']; |
704 | 704 | } |
705 | 705 | |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | if(false !== $id && '0' !== $id){ |
733 | 733 | $prev = get_post_meta($id,'location',true); |
734 | 734 | update_post_meta($id,'location',$location_data,$prev); |
735 | - }else{ |
|
735 | + } else{ |
|
736 | 736 | add_post_meta($id,'location',$location_data,true); |
737 | 737 | } |
738 | 738 | } |
@@ -752,12 +752,10 @@ discard block |
||
752 | 752 | $term = wp_insert_term(trim($data[0]['position']['country']), 'location'); |
753 | 753 | if ( is_wp_error($term) ){ |
754 | 754 | echo $term->get_error_message(); |
755 | - } |
|
756 | - else { |
|
755 | + } else { |
|
757 | 756 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
758 | 757 | } |
759 | - } |
|
760 | - else |
|
758 | + } else |
|
761 | 759 | { |
762 | 760 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
763 | 761 | } |
@@ -770,10 +768,8 @@ discard block |
||
770 | 768 | if(!$term = term_exists(trim($data[0]['position']['destination']), 'location')) |
771 | 769 | { |
772 | 770 | $term = wp_insert_term(trim($data[0]['position']['destination']), 'location', $tax_args); |
773 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
774 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
775 | - } |
|
776 | - else |
|
771 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
772 | + } else |
|
777 | 773 | { |
778 | 774 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
779 | 775 | } |
@@ -821,10 +817,8 @@ discard block |
||
821 | 817 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
822 | 818 | { |
823 | 819 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
824 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
825 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
826 | - } |
|
827 | - else |
|
820 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
821 | + } else |
|
828 | 822 | { |
829 | 823 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
830 | 824 | } |
@@ -883,14 +877,14 @@ discard block |
||
883 | 877 | |
884 | 878 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
885 | 879 | $room_count = $data[0]['features']['rooms']; |
886 | - }else{ |
|
880 | + } else{ |
|
887 | 881 | $room_count = count($data[0]['rooms']); |
888 | 882 | } |
889 | 883 | |
890 | 884 | if(false !== $id && '0' !== $id){ |
891 | 885 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
892 | 886 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
893 | - }else{ |
|
887 | + } else{ |
|
894 | 888 | add_post_meta($id,'number_of_rooms',$room_count,true); |
895 | 889 | } |
896 | 890 | } |
@@ -903,7 +897,7 @@ discard block |
||
903 | 897 | |
904 | 898 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
905 | 899 | $rating_type = $data[0]['features']['star_authority']; |
906 | - }else{ |
|
900 | + } else{ |
|
907 | 901 | $rating_type = 'Unspecified2'; |
908 | 902 | } |
909 | 903 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -1033,10 +1027,8 @@ discard block |
||
1033 | 1027 | { |
1034 | 1028 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
1035 | 1029 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
1036 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
1037 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
1038 | - } |
|
1039 | - else |
|
1030 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
1031 | + } else |
|
1040 | 1032 | { |
1041 | 1033 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
1042 | 1034 | } |
@@ -1197,8 +1189,7 @@ discard block |
||
1197 | 1189 | if ( !empty( $filename) && " " != $filename ) |
1198 | 1190 | { |
1199 | 1191 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
1200 | - } |
|
1201 | - else |
|
1192 | + } else |
|
1202 | 1193 | { |
1203 | 1194 | $file_array['name'] = $url_filename; // just use original URL filename |
1204 | 1195 | } |