@@ -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 | } |
@@ -357,10 +357,10 @@ discard block |
||
| 357 | 357 | if('import' === $post_status) { |
| 358 | 358 | if(is_array($this->queued_imports) && in_array($row->post_id,$this->queued_imports)){ |
| 359 | 359 | $searched_items[sanitize_title($row->name) . '-' . $row->meta_value] = $this->format_row($row); |
| 360 | - }else{ |
|
| 360 | + } else{ |
|
| 361 | 361 | continue; |
| 362 | 362 | } |
| 363 | - }else if (false !== $post_status) { |
|
| 363 | + } else if (false !== $post_status) { |
|
| 364 | 364 | |
| 365 | 365 | $current_status = get_post_status($row->post_id); |
| 366 | 366 | if ($current_status !== $post_status) { |
@@ -468,10 +468,10 @@ discard block |
||
| 468 | 468 | $return = $this->import_row($adata, $wetu_id, $post_id, $team_members, $content, $safari_brands); |
| 469 | 469 | $this->remove_from_queue($return); |
| 470 | 470 | $this->format_completed_row($return); |
| 471 | - }else{ |
|
| 471 | + } else{ |
|
| 472 | 472 | if(isset($adata['error'])){ |
| 473 | 473 | $this->format_error($adata['error']); |
| 474 | - }else{ |
|
| 474 | + } else{ |
|
| 475 | 475 | $this->format_error(esc_html__('There was a problem importing your destination, please try refreshing the page.','wetu-importer')); |
| 476 | 476 | } |
| 477 | 477 | } |
@@ -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 | |
@@ -409,19 +409,19 @@ discard block |
||
| 409 | 409 | $wetu_id = $_POST['wetu_id']; |
| 410 | 410 | if(isset($_POST['post_id'])){ |
| 411 | 411 | $post_id = $_POST['post_id']; |
| 412 | - }else{ |
|
| 412 | + } else{ |
|
| 413 | 413 | $post_id = 0; |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | if(isset($_POST['team_members'])){ |
| 417 | 417 | $team_members = $_POST['team_members']; |
| 418 | - }else{ |
|
| 418 | + } else{ |
|
| 419 | 419 | $team_members = false; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | if(isset($_POST['safari_brands'])){ |
| 423 | 423 | $safari_brands = $_POST['safari_brands']; |
| 424 | - }else{ |
|
| 424 | + } else{ |
|
| 425 | 425 | $safari_brands = false; |
| 426 | 426 | } |
| 427 | 427 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
| 430 | 430 | $content = $_POST['content']; |
| 431 | 431 | add_option('wetu_importer_accommodation_settings',$content); |
| 432 | - }else{ |
|
| 432 | + } else{ |
|
| 433 | 433 | |
| 434 | 434 | $content = false; |
| 435 | 435 | } |
@@ -443,10 +443,10 @@ discard block |
||
| 443 | 443 | $this->format_completed_row($return); |
| 444 | 444 | $this->remove_from_queue($return); |
| 445 | 445 | $this->cleanup_posts(); |
| 446 | - }else{ |
|
| 446 | + } else{ |
|
| 447 | 447 | if(isset($adata['error'])){ |
| 448 | 448 | $this->format_error($adata['error']); |
| 449 | - }else{ |
|
| 449 | + } else{ |
|
| 450 | 450 | $this->format_error(esc_html__('There was a problem importing your accommodation, please try refreshing the page.','wetu-importer')); |
| 451 | 451 | } |
| 452 | 452 | } |
@@ -471,10 +471,10 @@ discard block |
||
| 471 | 471 | if(isset($data[0]['content']['extended_description'])) |
| 472 | 472 | { |
| 473 | 473 | $data_post_content = $data[0]['content']['extended_description']; |
| 474 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
| 474 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
| 475 | 475 | $data_post_content = $data[0]['content']['general_description']; |
| 476 | 476 | $content_used_general_description = true; |
| 477 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
| 477 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
| 478 | 478 | $data_post_content = $data[0]['content']['teaser_description']; |
| 479 | 479 | } |
| 480 | 480 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
| 485 | 485 | if(isset($data[0]['content']['teaser_description'])){ |
| 486 | 486 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
| 487 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
| 487 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
| 488 | 488 | $data_post_excerpt = $data[0]['content']['general_description']; |
| 489 | 489 | } |
| 490 | 490 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | $id = wp_update_post($post); |
| 501 | 501 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
| 502 | 502 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
| 503 | - }else{ |
|
| 503 | + } else{ |
|
| 504 | 504 | |
| 505 | 505 | //Set the name |
| 506 | 506 | if(isset($data[0]['name'])){ |
@@ -663,10 +663,8 @@ discard block |
||
| 663 | 663 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
| 664 | 664 | { |
| 665 | 665 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
| 666 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 667 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
| 668 | - } |
|
| 669 | - else |
|
| 666 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
| 667 | + } else |
|
| 670 | 668 | { |
| 671 | 669 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
| 672 | 670 | } |
@@ -725,14 +723,14 @@ discard block |
||
| 725 | 723 | |
| 726 | 724 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
| 727 | 725 | $room_count = $data[0]['features']['rooms']; |
| 728 | - }else{ |
|
| 726 | + } else{ |
|
| 729 | 727 | $room_count = count($data[0]['rooms']); |
| 730 | 728 | } |
| 731 | 729 | |
| 732 | 730 | if(false !== $id && '0' !== $id){ |
| 733 | 731 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
| 734 | 732 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
| 735 | - }else{ |
|
| 733 | + } else{ |
|
| 736 | 734 | add_post_meta($id,'number_of_rooms',$room_count,true); |
| 737 | 735 | } |
| 738 | 736 | } |
@@ -745,7 +743,7 @@ discard block |
||
| 745 | 743 | |
| 746 | 744 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
| 747 | 745 | $rating_type = $data[0]['features']['star_authority']; |
| 748 | - }else{ |
|
| 746 | + } else{ |
|
| 749 | 747 | $rating_type = 'Unspecified2'; |
| 750 | 748 | } |
| 751 | 749 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -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 | |
@@ -536,10 +536,10 @@ discard block |
||
| 536 | 536 | $this->save_queue(); |
| 537 | 537 | $this->cleanup_posts(); |
| 538 | 538 | $this->attach_destination_images($content); |
| 539 | - }else{ |
|
| 539 | + } else{ |
|
| 540 | 540 | if(isset($adata['error'])){ |
| 541 | 541 | $this->format_error($adata['error']); |
| 542 | - }else{ |
|
| 542 | + } else{ |
|
| 543 | 543 | $this->format_error(esc_html__('There was a problem importing your tour, please try refreshing the page.','wetu-importer')); |
| 544 | 544 | } |
| 545 | 545 | } |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | if(isset($data['description'])){ |
| 568 | 568 | $data_post_content = $data['description']; |
| 569 | - }elseif(isset($data['summary'])){ |
|
| 569 | + } elseif(isset($data['summary'])){ |
|
| 570 | 570 | $data_post_content = $data['summary']; |
| 571 | 571 | } |
| 572 | 572 | $post['post_content'] = $data_post_content; |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | $id = wp_update_post($post); |
| 580 | 580 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
| 581 | 581 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date); |
| 582 | - }else{ |
|
| 582 | + } else{ |
|
| 583 | 583 | |
| 584 | 584 | //Set the name |
| 585 | 585 | if(isset($data['name'])){ |
@@ -670,42 +670,42 @@ discard block |
||
| 670 | 670 | //Description |
| 671 | 671 | if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes'])){ |
| 672 | 672 | $current_day['description'] = $day['notes']; |
| 673 | - }else{ |
|
| 673 | + } else{ |
|
| 674 | 674 | $current_day['description'] = ''; |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | //Itinerary Gallery |
| 678 | 678 | if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){ |
| 679 | 679 | $current_day['featured_image'] = ''; |
| 680 | - }else{ |
|
| 680 | + } else{ |
|
| 681 | 681 | $current_day['featured_image'] = ''; |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | //Accommodation |
| 685 | 685 | if(false !== $current_accommodation){ |
| 686 | 686 | $current_day['accommodation_to_tour'] = array($current_accommodation); |
| 687 | - }else{ |
|
| 687 | + } else{ |
|
| 688 | 688 | $current_day['accommodation_to_tour'] = array(); |
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | //Destination |
| 692 | 692 | if(false !== $current_destination){ |
| 693 | 693 | $current_day['destination_to_tour'] = array($current_destination); |
| 694 | - }else{ |
|
| 694 | + } else{ |
|
| 695 | 695 | $current_day['destination_to_tour'] = array(); |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | //Included |
| 699 | 699 | if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){ |
| 700 | 700 | $current_day['included'] = $day['included']; |
| 701 | - }else{ |
|
| 701 | + } else{ |
|
| 702 | 702 | $current_day['included'] = ''; |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | //Excluded |
| 706 | 706 | if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){ |
| 707 | 707 | $current_day['excluded'] = $day['excluded']; |
| 708 | - }else{ |
|
| 708 | + } else{ |
|
| 709 | 709 | $current_day['excluded'] = ''; |
| 710 | 710 | } |
| 711 | 711 | |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | $day_counter++; |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | - }else{ |
|
| 716 | + } else{ |
|
| 717 | 717 | $day_counter = $day_counter + (int)$leg['nights']; |
| 718 | 718 | } |
| 719 | 719 | |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | |
| 827 | 827 | if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){ |
| 828 | 828 | $ac_id = $this->current_accommodation[$day['content_entity_id']]; |
| 829 | - }else{ |
|
| 829 | + } else{ |
|
| 830 | 830 | $ac_id = wp_insert_post(array( |
| 831 | 831 | 'post_type' => 'accommodation', |
| 832 | 832 | 'post_status' => 'draft', |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | $country_id = $this->set_country($country_wetu_id, $id); |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | - }else { |
|
| 899 | + } else { |
|
| 900 | 900 | |
| 901 | 901 | $destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']); |
| 902 | 902 | |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | if(0 !== $country_id && false !== $country_id){ |
| 956 | 956 | $this->relation_meta[$dest_id] = $country_id; |
| 957 | 957 | $this->relation_meta[$country_id] = 0; |
| 958 | - }else{ |
|
| 958 | + } else{ |
|
| 959 | 959 | $this->relation_meta[$dest_id] = 0; |
| 960 | 960 | } |
| 961 | 961 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | public function queue_item($id) { |
| 1063 | 1063 | if(is_array($this->import_queue) && !in_array($id,$this->import_queue)){ |
| 1064 | 1064 | $this->import_queue[] = $id; |
| 1065 | - }else{ |
|
| 1065 | + } else{ |
|
| 1066 | 1066 | $this->import_queue[] = $id; |
| 1067 | 1067 | } |
| 1068 | 1068 | } |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | if (!empty($this->queued_imports)) { |
| 1077 | 1077 | $saved_imports = array_merge($this->queued_imports,$this->import_queue); |
| 1078 | 1078 | |
| 1079 | - }else{ |
|
| 1079 | + } else{ |
|
| 1080 | 1080 | $saved_imports = $this->import_queue; |
| 1081 | 1081 | } |
| 1082 | 1082 | delete_option('wetu_importer_que'); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | if (isset($temp_options['api']['wetu_api_password']) && '' !== $temp_options['api']['wetu_api_password']) { |
| 228 | 228 | $this->api_password = $temp_options['api']['wetu_api_password']; |
| 229 | 229 | } |
| 230 | - }else{ |
|
| 230 | + } else{ |
|
| 231 | 231 | $this->api_key = WETU_API_KEY; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | <?php } ?> |
| 412 | 412 | </ul> |
| 413 | 413 | <?php*/ |
| 414 | - }else{ |
|
| 414 | + } else{ |
|
| 415 | 415 | $this->current_importer->display_page(); |
| 416 | 416 | }; ?> |
| 417 | 417 | </div> |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | |
| 448 | 448 | <?php if('tour'===$this->tab_slug){ ?> |
| 449 | 449 | | <a class="import search-toggle" href="#import"><?php esc_attr_e('WETU','wetu-importer'); ?></a> |
| 450 | - <?php }else if(!empty($this->queued_imports)) { ?> |
|
| 450 | + <?php } else if(!empty($this->queued_imports)) { ?> |
|
| 451 | 451 | | <a class="import search-toggle" href="#import"><?php esc_attr_e('WETU Queue','wetu-importer'); ?></a> |
| 452 | 452 | <?php } ?> |
| 453 | 453 | </p> |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | foreach($team_members->posts as $member){ ?> |
| 538 | 538 | <li><input class="team" <?php $this->checked($selected,$member); ?> type="checkbox" value="<?php echo $member; ?>" /> <?php echo get_the_title($member); ?></li> |
| 539 | 539 | <?php } |
| 540 | - }else{ ?> |
|
| 540 | + } else{ ?> |
|
| 541 | 541 | <li><input class="team" type="checkbox" value="0" /> <?php _e('None','wetu-importer'); ?></li> |
| 542 | 542 | <?php } |
| 543 | 543 | ?> |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | if (in_array($needle, $haystack)) { |
| 603 | 603 | if(true === $wrap || 'true' === $wrap) { |
| 604 | 604 | $html = $type . '="' . $type . '"'; |
| 605 | - }else{ |
|
| 605 | + } else{ |
|
| 606 | 606 | $html = $type; |
| 607 | 607 | } |
| 608 | 608 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | |
| 655 | 655 | if(false !== $id && '0' !== $id && false !== $prev && true === $unique){ |
| 656 | 656 | update_post_meta($id,$meta_key,$value,$prev); |
| 657 | - }else{ |
|
| 657 | + } else{ |
|
| 658 | 658 | add_post_meta($id,$meta_key,$value,$unique); |
| 659 | 659 | } |
| 660 | 660 | } |
@@ -695,18 +695,15 @@ discard block |
||
| 695 | 695 | if ( is_wp_error($term) ) |
| 696 | 696 | { |
| 697 | 697 | echo $term->get_error_message(); |
| 698 | - } |
|
| 699 | - else |
|
| 698 | + } else |
|
| 700 | 699 | { |
| 701 | 700 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
| 702 | 701 | } |
| 703 | - } |
|
| 704 | - else |
|
| 702 | + } else |
|
| 705 | 703 | { |
| 706 | 704 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
| 707 | 705 | } |
| 708 | - } |
|
| 709 | - else |
|
| 706 | + } else |
|
| 710 | 707 | { |
| 711 | 708 | $result[]=trim($k); |
| 712 | 709 | } |
@@ -720,10 +717,8 @@ discard block |
||
| 720 | 717 | { |
| 721 | 718 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
| 722 | 719 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
| 723 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 724 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
| 725 | - } |
|
| 726 | - else |
|
| 720 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
| 721 | + } else |
|
| 727 | 722 | { |
| 728 | 723 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
| 729 | 724 | } |
@@ -743,7 +738,7 @@ discard block |
||
| 743 | 738 | foreach($terms as $term){ |
| 744 | 739 | $return .= '<li><input class="'.$taxonomy.'" '.$this->checked($selected,$term->term_id,false).' type="checkbox" value="'.$term->term_id.'" /> '.$term->name.'</li>'; |
| 745 | 740 | } |
| 746 | - }else{ |
|
| 741 | + } else{ |
|
| 747 | 742 | $return .= '<li><input type="checkbox" value="" /> '.__('None','wetu-importer').'</li>'; |
| 748 | 743 | } |
| 749 | 744 | $return .= '</ul>'; |
@@ -762,13 +757,13 @@ discard block |
||
| 762 | 757 | |
| 763 | 758 | if(isset($data[0]['position']['driving_latitude'])){ |
| 764 | 759 | $latitude = $data[0]['position']['driving_latitude']; |
| 765 | - }elseif(isset($data[0]['position']['latitude'])){ |
|
| 760 | + } elseif(isset($data[0]['position']['latitude'])){ |
|
| 766 | 761 | $latitude = $data[0]['position']['latitude']; |
| 767 | 762 | } |
| 768 | 763 | |
| 769 | 764 | if(isset($data[0]['position']['driving_longitude'])){ |
| 770 | 765 | $longitude = $data[0]['position']['driving_longitude']; |
| 771 | - }elseif(isset($data[0]['position']['longitude'])){ |
|
| 766 | + } elseif(isset($data[0]['position']['longitude'])){ |
|
| 772 | 767 | $longitude = $data[0]['position']['longitude']; |
| 773 | 768 | } |
| 774 | 769 | |
@@ -800,7 +795,7 @@ discard block |
||
| 800 | 795 | if(false !== $id && '0' !== $id){ |
| 801 | 796 | $prev = get_post_meta($id,'location',true); |
| 802 | 797 | update_post_meta($id,'location',$location_data,$prev); |
| 803 | - }else{ |
|
| 798 | + } else{ |
|
| 804 | 799 | add_post_meta($id,'location',$location_data,true); |
| 805 | 800 | } |
| 806 | 801 | } |
@@ -1015,8 +1010,7 @@ discard block |
||
| 1015 | 1010 | if ( !empty( $filename) && " " != $filename ) |
| 1016 | 1011 | { |
| 1017 | 1012 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
| 1018 | - } |
|
| 1019 | - else |
|
| 1013 | + } else |
|
| 1020 | 1014 | { |
| 1021 | 1015 | $file_array['name'] = $url_filename; // just use original URL filename |
| 1022 | 1016 | } |
@@ -1097,7 +1091,7 @@ discard block |
||
| 1097 | 1091 | } |
| 1098 | 1092 | if(false !== $found && $needle_count === count($found)){ |
| 1099 | 1093 | return true; |
| 1100 | - }else{ |
|
| 1094 | + } else{ |
|
| 1101 | 1095 | return false; |
| 1102 | 1096 | } |
| 1103 | 1097 | } |