@@ -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 | } |
@@ -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 | } |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | |
220 | 220 | if(true === $result){ |
221 | 221 | echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</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','wetu-importer').'</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 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | if(isset($_POST['keyword'] )) { |
286 | 286 | $keyphrases = $_POST['keyword']; |
287 | - }else{ |
|
287 | + } else{ |
|
288 | 288 | $keyphrases = array(0); |
289 | 289 | } |
290 | 290 | |
@@ -336,16 +336,16 @@ discard block |
||
336 | 336 | |
337 | 337 | if(0 !== $row['post_id']){ |
338 | 338 | continue; |
339 | - }else{ |
|
339 | + } else{ |
|
340 | 340 | $searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row); |
341 | 341 | } |
342 | 342 | |
343 | 343 | |
344 | - }else{ |
|
344 | + } else{ |
|
345 | 345 | |
346 | 346 | if(0 === $row['post_id']){ |
347 | 347 | continue; |
348 | - }else{ |
|
348 | + } else{ |
|
349 | 349 | $current_status = get_post_status($row['post_id']); |
350 | 350 | if($current_status !== $post_status){ |
351 | 351 | continue; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | |
357 | 357 | } |
358 | 358 | |
359 | - }else{ |
|
359 | + } else{ |
|
360 | 360 | //Search through each keyword. |
361 | 361 | foreach($keyphrases as $keyphrase){ |
362 | 362 | |
@@ -425,13 +425,13 @@ discard block |
||
425 | 425 | $wetu_id = $_POST['wetu_id']; |
426 | 426 | if(isset($_POST['post_id'])){ |
427 | 427 | $post_id = $_POST['post_id']; |
428 | - }else{ |
|
428 | + } else{ |
|
429 | 429 | $post_id = 0; |
430 | 430 | } |
431 | 431 | |
432 | 432 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
433 | 433 | $content = $_POST['content']; |
434 | - }else{ |
|
434 | + } else{ |
|
435 | 435 | $content = false; |
436 | 436 | } |
437 | 437 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | if(isset($data['description'])){ |
472 | 472 | $data_post_content = $data['description']; |
473 | - }elseif(isset($data['summary'])){ |
|
473 | + } elseif(isset($data['summary'])){ |
|
474 | 474 | $data_post_content = $data['summary']; |
475 | 475 | $content_used_general_description = true; |
476 | 476 | } |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $id = wp_update_post($post); |
492 | 492 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
493 | 493 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date); |
494 | - }else{ |
|
494 | + } else{ |
|
495 | 495 | |
496 | 496 | //Set the name |
497 | 497 | if(isset($data['name'])){ |
@@ -596,28 +596,28 @@ discard block |
||
596 | 596 | //Description |
597 | 597 | if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes']) && '' !== $day['notes']){ |
598 | 598 | $current_day['description'] = strip_tags($day['notes']); |
599 | - }else{ |
|
599 | + } else{ |
|
600 | 600 | $current_day['description'] = ''; |
601 | 601 | } |
602 | 602 | |
603 | 603 | //Itinerary Gallery |
604 | 604 | if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){ |
605 | 605 | $current_day['featured_image'] = ''; |
606 | - }else{ |
|
606 | + } else{ |
|
607 | 607 | $current_day['featured_image'] = ''; |
608 | 608 | } |
609 | 609 | |
610 | 610 | //Accommodation |
611 | 611 | if(false !== $current_accommodation){ |
612 | 612 | $current_day['accommodation_to_tour'] = array($current_accommodation); |
613 | - }else{ |
|
613 | + } else{ |
|
614 | 614 | $current_day['accommodation_to_tour'] = array(); |
615 | 615 | } |
616 | 616 | |
617 | 617 | //Destination |
618 | 618 | if(false !== $current_destination){ |
619 | 619 | $current_day['destination_to_tour'] = array($current_destination); |
620 | - }else{ |
|
620 | + } else{ |
|
621 | 621 | $current_day['destination_to_tour'] = array(); |
622 | 622 | } |
623 | 623 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | $day_counter++; |
626 | 626 | } |
627 | 627 | |
628 | - }else{ |
|
628 | + } else{ |
|
629 | 629 | $day_counter = $day_counter + (int)$leg['nights']; |
630 | 630 | } |
631 | 631 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | |
708 | 708 | if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){ |
709 | 709 | $ac_id = $this->current_accommodation[$day['content_entity_id']]; |
710 | - }else{ |
|
710 | + } else{ |
|
711 | 711 | $ac_id = wp_insert_post(array( |
712 | 712 | 'post_type' => 'accommodation', |
713 | 713 | 'post_status' => 'draft', |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | $this->set_country($country_wetu_id, $id); |
775 | 775 | } |
776 | 776 | |
777 | - }else { |
|
777 | + } else { |
|
778 | 778 | |
779 | 779 | $destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']); |
780 | 780 |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | if(isset($_POST['keyword'] )) { |
293 | 293 | $keyphrases = $_POST['keyword']; |
294 | - }else{ |
|
294 | + } else{ |
|
295 | 295 | $keyphrases = array(0); |
296 | 296 | } |
297 | 297 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $searched_items[sanitize_title($row->name).'-'.$row->meta_value] = $this->format_row($row); |
330 | 330 | |
331 | 331 | |
332 | - }else{ |
|
332 | + } else{ |
|
333 | 333 | //Search through each keyword. |
334 | 334 | foreach($keyphrases as $keyphrase){ |
335 | 335 | |
@@ -398,13 +398,13 @@ discard block |
||
398 | 398 | $wetu_id = $_POST['wetu_id']; |
399 | 399 | if(isset($_POST['post_id'])){ |
400 | 400 | $post_id = $_POST['post_id']; |
401 | - }else{ |
|
401 | + } else{ |
|
402 | 402 | $post_id = 0; |
403 | 403 | } |
404 | 404 | |
405 | 405 | if(isset($_POST['team_members'])){ |
406 | 406 | $team_members = $_POST['team_members']; |
407 | - }else{ |
|
407 | + } else{ |
|
408 | 408 | $team_members = false; |
409 | 409 | } |
410 | 410 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | |
413 | 413 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
414 | 414 | $content = $_POST['content']; |
415 | - }else{ |
|
415 | + } else{ |
|
416 | 416 | $content = false; |
417 | 417 | } |
418 | 418 | |
@@ -451,10 +451,10 @@ discard block |
||
451 | 451 | if(isset($data[0]['content']['extended_description'])) |
452 | 452 | { |
453 | 453 | $data_post_content = $data[0]['content']['extended_description']; |
454 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
454 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
455 | 455 | $data_post_content = $data[0]['content']['general_description']; |
456 | 456 | $content_used_general_description = true; |
457 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
457 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
458 | 458 | $data_post_content = $data[0]['content']['teaser_description']; |
459 | 459 | } |
460 | 460 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -464,9 +464,9 @@ discard block |
||
464 | 464 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
465 | 465 | if(isset($data[0]['content']['teaser_description'])){ |
466 | 466 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
467 | - }elseif(isset($data[0]['content']['extended_description'])){ |
|
467 | + } elseif(isset($data[0]['content']['extended_description'])){ |
|
468 | 468 | $data_post_excerpt = $data[0]['content']['extended_description']; |
469 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
469 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
470 | 470 | $data_post_excerpt = $data[0]['content']['general_description']; |
471 | 471 | } |
472 | 472 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $id = wp_update_post($post); |
483 | 483 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
484 | 484 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
485 | - }else{ |
|
485 | + } else{ |
|
486 | 486 | |
487 | 487 | //Set the name |
488 | 488 | if(isset($data[0]['name'])){ |
@@ -565,13 +565,13 @@ discard block |
||
565 | 565 | |
566 | 566 | if(isset($data[0]['position']['driving_latitude'])){ |
567 | 567 | $latitude = $data[0]['position']['driving_latitude']; |
568 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
568 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
569 | 569 | $latitude = $data[0]['position']['latitude']; |
570 | 570 | } |
571 | 571 | |
572 | 572 | if(isset($data[0]['position']['driving_longitude'])){ |
573 | 573 | $longitude = $data[0]['position']['driving_longitude']; |
574 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
574 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
575 | 575 | $longitude = $data[0]['position']['longitude']; |
576 | 576 | } |
577 | 577 | |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | if(false !== $id && '0' !== $id){ |
605 | 605 | $prev = get_post_meta($id,'location',true); |
606 | 606 | update_post_meta($id,'location',$location_data,$prev); |
607 | - }else{ |
|
607 | + } else{ |
|
608 | 608 | add_post_meta($id,'location',$location_data,true); |
609 | 609 | } |
610 | 610 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | if(isset($accommodation['error'])){ |
288 | 288 | return $accommodation['error']; |
289 | - }elseif (isset($accommodation) && !empty($accommodation)) { |
|
289 | + } elseif (isset($accommodation) && !empty($accommodation)) { |
|
290 | 290 | set_transient('lsx_ti_accommodation',$accommodation,60*60*2); |
291 | 291 | return true; |
292 | 292 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | if(isset($_POST['keyword'] )) { |
334 | 334 | $keyphrases = $_POST['keyword']; |
335 | - }else{ |
|
335 | + } else{ |
|
336 | 336 | $keyphrases = array(0); |
337 | 337 | } |
338 | 338 | |
@@ -377,16 +377,16 @@ discard block |
||
377 | 377 | |
378 | 378 | if(0 !== $row['post_id']){ |
379 | 379 | continue; |
380 | - }else{ |
|
380 | + } else{ |
|
381 | 381 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
382 | 382 | } |
383 | 383 | |
384 | 384 | |
385 | - }else{ |
|
385 | + } else{ |
|
386 | 386 | |
387 | 387 | if(0 === $row['post_id']){ |
388 | 388 | continue; |
389 | - }else{ |
|
389 | + } else{ |
|
390 | 390 | $current_status = get_post_status($row['post_id']); |
391 | 391 | if($current_status !== $post_status){ |
392 | 392 | continue; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
397 | 397 | } |
398 | 398 | |
399 | - }else{ |
|
399 | + } else{ |
|
400 | 400 | //Search through each keyword. |
401 | 401 | foreach($keyphrases as $keyphrase){ |
402 | 402 | |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | if(false !== $found && $needle_count === count($found)){ |
440 | 440 | return true; |
441 | - }else{ |
|
441 | + } else{ |
|
442 | 442 | return false; |
443 | 443 | } |
444 | 444 | } |
@@ -484,25 +484,25 @@ discard block |
||
484 | 484 | $wetu_id = $_POST['wetu_id']; |
485 | 485 | if(isset($_POST['post_id'])){ |
486 | 486 | $post_id = $_POST['post_id']; |
487 | - }else{ |
|
487 | + } else{ |
|
488 | 488 | $post_id = 0; |
489 | 489 | } |
490 | 490 | |
491 | 491 | if(isset($_POST['team_members'])){ |
492 | 492 | $team_members = $_POST['team_members']; |
493 | - }else{ |
|
493 | + } else{ |
|
494 | 494 | $team_members = false; |
495 | 495 | } |
496 | 496 | |
497 | 497 | if(isset($_POST['safari_brands'])){ |
498 | 498 | $safari_brands = $_POST['safari_brands']; |
499 | - }else{ |
|
499 | + } else{ |
|
500 | 500 | $safari_brands = false; |
501 | 501 | } |
502 | 502 | |
503 | 503 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
504 | 504 | $content = $_POST['content']; |
505 | - }else{ |
|
505 | + } else{ |
|
506 | 506 | $content = false; |
507 | 507 | } |
508 | 508 | |
@@ -546,10 +546,10 @@ discard block |
||
546 | 546 | if(isset($data[0]['content']['extended_description'])) |
547 | 547 | { |
548 | 548 | $data_post_content = $data[0]['content']['extended_description']; |
549 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
549 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
550 | 550 | $data_post_content = $data[0]['content']['general_description']; |
551 | 551 | $content_used_general_description = true; |
552 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
552 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
553 | 553 | $data_post_content = $data[0]['content']['teaser_description']; |
554 | 554 | } |
555 | 555 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
560 | 560 | if(isset($data[0]['content']['teaser_description'])){ |
561 | 561 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
562 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
562 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
563 | 563 | $data_post_excerpt = $data[0]['content']['general_description']; |
564 | 564 | } |
565 | 565 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | $id = wp_update_post($post); |
576 | 576 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
577 | 577 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
578 | - }else{ |
|
578 | + } else{ |
|
579 | 579 | |
580 | 580 | //Set the name |
581 | 581 | if(isset($data[0]['name'])){ |
@@ -707,13 +707,13 @@ discard block |
||
707 | 707 | |
708 | 708 | if(isset($data[0]['position']['driving_latitude'])){ |
709 | 709 | $latitude = $data[0]['position']['driving_latitude']; |
710 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
710 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
711 | 711 | $latitude = $data[0]['position']['latitude']; |
712 | 712 | } |
713 | 713 | |
714 | 714 | if(isset($data[0]['position']['driving_longitude'])){ |
715 | 715 | $longitude = $data[0]['position']['driving_longitude']; |
716 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
716 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
717 | 717 | $longitude = $data[0]['position']['longitude']; |
718 | 718 | } |
719 | 719 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | if(false !== $id && '0' !== $id){ |
747 | 747 | $prev = get_post_meta($id,'location',true); |
748 | 748 | update_post_meta($id,'location',$location_data,$prev); |
749 | - }else{ |
|
749 | + } else{ |
|
750 | 750 | add_post_meta($id,'location',$location_data,true); |
751 | 751 | } |
752 | 752 | } |
@@ -766,12 +766,10 @@ discard block |
||
766 | 766 | $term = wp_insert_term(trim($data[0]['position']['country']), 'location'); |
767 | 767 | if ( is_wp_error($term) ){ |
768 | 768 | echo $term->get_error_message(); |
769 | - } |
|
770 | - else { |
|
769 | + } else { |
|
771 | 770 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
772 | 771 | } |
773 | - } |
|
774 | - else |
|
772 | + } else |
|
775 | 773 | { |
776 | 774 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
777 | 775 | } |
@@ -784,10 +782,8 @@ discard block |
||
784 | 782 | if(!$term = term_exists(trim($data[0]['position']['destination']), 'location')) |
785 | 783 | { |
786 | 784 | $term = wp_insert_term(trim($data[0]['position']['destination']), 'location', $tax_args); |
787 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
788 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
789 | - } |
|
790 | - else |
|
785 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
786 | + } else |
|
791 | 787 | { |
792 | 788 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
793 | 789 | } |
@@ -835,10 +831,8 @@ discard block |
||
835 | 831 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
836 | 832 | { |
837 | 833 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
838 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
839 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
840 | - } |
|
841 | - else |
|
834 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
835 | + } else |
|
842 | 836 | { |
843 | 837 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
844 | 838 | } |
@@ -897,14 +891,14 @@ discard block |
||
897 | 891 | |
898 | 892 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
899 | 893 | $room_count = $data[0]['features']['rooms']; |
900 | - }else{ |
|
894 | + } else{ |
|
901 | 895 | $room_count = count($data[0]['rooms']); |
902 | 896 | } |
903 | 897 | |
904 | 898 | if(false !== $id && '0' !== $id){ |
905 | 899 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
906 | 900 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
907 | - }else{ |
|
901 | + } else{ |
|
908 | 902 | add_post_meta($id,'number_of_rooms',$room_count,true); |
909 | 903 | } |
910 | 904 | } |
@@ -917,7 +911,7 @@ discard block |
||
917 | 911 | |
918 | 912 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
919 | 913 | $rating_type = $data[0]['features']['star_authority']; |
920 | - }else{ |
|
914 | + } else{ |
|
921 | 915 | $rating_type = 'Unspecified2'; |
922 | 916 | } |
923 | 917 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -1047,10 +1041,8 @@ discard block |
||
1047 | 1041 | { |
1048 | 1042 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
1049 | 1043 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
1050 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
1051 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
1052 | - } |
|
1053 | - else |
|
1044 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
1045 | + } else |
|
1054 | 1046 | { |
1055 | 1047 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
1056 | 1048 | } |
@@ -1211,8 +1203,7 @@ discard block |
||
1211 | 1203 | if ( !empty( $filename) && " " != $filename ) |
1212 | 1204 | { |
1213 | 1205 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
1214 | - } |
|
1215 | - else |
|
1206 | + } else |
|
1216 | 1207 | { |
1217 | 1208 | $file_array['name'] = $url_filename; // just use original URL filename |
1218 | 1209 | } |