@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | if(isset($accommodation['error'])){ |
| 317 | 317 | return $accommodation['error']; |
| 318 | - }elseif (isset($accommodation) && !empty($accommodation)) { |
|
| 318 | + } elseif (isset($accommodation) && !empty($accommodation)) { |
|
| 319 | 319 | set_transient('lsx_ti_accommodation',$accommodation,60*60*2); |
| 320 | 320 | return true; |
| 321 | 321 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | if(isset($_POST['keyword'] )) { |
| 363 | 363 | $keyphrases = $_POST['keyword']; |
| 364 | - }else{ |
|
| 364 | + } else{ |
|
| 365 | 365 | $keyphrases = array(0); |
| 366 | 366 | } |
| 367 | 367 | |
@@ -406,16 +406,16 @@ discard block |
||
| 406 | 406 | |
| 407 | 407 | if(0 !== $row['post_id']){ |
| 408 | 408 | continue; |
| 409 | - }else{ |
|
| 409 | + } else{ |
|
| 410 | 410 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
| 414 | - }else{ |
|
| 414 | + } else{ |
|
| 415 | 415 | |
| 416 | 416 | if(0 === $row['post_id']){ |
| 417 | 417 | continue; |
| 418 | - }else{ |
|
| 418 | + } else{ |
|
| 419 | 419 | $current_status = get_post_status($row['post_id']); |
| 420 | 420 | if($current_status !== $post_status){ |
| 421 | 421 | continue; |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row); |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | - }else{ |
|
| 428 | + } else{ |
|
| 429 | 429 | //Search through each keyword. |
| 430 | 430 | foreach($keyphrases as $keyphrase){ |
| 431 | 431 | |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | if(false !== $found && $needle_count === count($found)){ |
| 469 | 469 | return true; |
| 470 | - }else{ |
|
| 470 | + } else{ |
|
| 471 | 471 | return false; |
| 472 | 472 | } |
| 473 | 473 | } |
@@ -513,26 +513,26 @@ 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 | |
| 520 | 520 | if(isset($_POST['team_members'])){ |
| 521 | 521 | $team_members = $_POST['team_members']; |
| 522 | - }else{ |
|
| 522 | + } else{ |
|
| 523 | 523 | $team_members = false; |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | if(isset($_POST['safari_brands'])){ |
| 527 | 527 | $safari_brands = $_POST['safari_brands']; |
| 528 | - }else{ |
|
| 528 | + } else{ |
|
| 529 | 529 | $safari_brands = false; |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){ |
| 533 | 533 | $content = $_POST['content']; |
| 534 | 534 | add_option('wetu_importer_accommodation_settings',$content); |
| 535 | - }else{ |
|
| 535 | + } else{ |
|
| 536 | 536 | delete_option('wetu_importer_accommodation_settings'); |
| 537 | 537 | $content = false; |
| 538 | 538 | } |
@@ -577,10 +577,10 @@ discard block |
||
| 577 | 577 | if(isset($data[0]['content']['extended_description'])) |
| 578 | 578 | { |
| 579 | 579 | $data_post_content = $data[0]['content']['extended_description']; |
| 580 | - }elseif(isset($data[0]['content']['general_description'])){ |
|
| 580 | + } elseif(isset($data[0]['content']['general_description'])){ |
|
| 581 | 581 | $data_post_content = $data[0]['content']['general_description']; |
| 582 | 582 | $content_used_general_description = true; |
| 583 | - }elseif(isset($data[0]['content']['teaser_description'])){ |
|
| 583 | + } elseif(isset($data[0]['content']['teaser_description'])){ |
|
| 584 | 584 | $data_post_content = $data[0]['content']['teaser_description']; |
| 585 | 585 | } |
| 586 | 586 | $post['post_content'] = wp_strip_all_tags($data_post_content); |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | if(false !== $importable_content && in_array('excerpt',$importable_content)){ |
| 591 | 591 | if(isset($data[0]['content']['teaser_description'])){ |
| 592 | 592 | $data_post_excerpt = $data[0]['content']['teaser_description']; |
| 593 | - }elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
| 593 | + } elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){ |
|
| 594 | 594 | $data_post_excerpt = $data[0]['content']['general_description']; |
| 595 | 595 | } |
| 596 | 596 | $post['post_excerpt'] = $data_post_excerpt; |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | $id = wp_update_post($post); |
| 607 | 607 | $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true); |
| 608 | 608 | update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date); |
| 609 | - }else{ |
|
| 609 | + } else{ |
|
| 610 | 610 | |
| 611 | 611 | //Set the name |
| 612 | 612 | 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 | |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | if(false !== $id && '0' !== $id){ |
| 778 | 778 | $prev = get_post_meta($id,'location',true); |
| 779 | 779 | update_post_meta($id,'location',$location_data,$prev); |
| 780 | - }else{ |
|
| 780 | + } else{ |
|
| 781 | 781 | add_post_meta($id,'location',$location_data,true); |
| 782 | 782 | } |
| 783 | 783 | } |
@@ -797,12 +797,10 @@ discard block |
||
| 797 | 797 | $term = wp_insert_term(trim($data[0]['position']['country']), 'location'); |
| 798 | 798 | if ( is_wp_error($term) ){ |
| 799 | 799 | echo $term->get_error_message(); |
| 800 | - } |
|
| 801 | - else { |
|
| 800 | + } else { |
|
| 802 | 801 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
| 803 | 802 | } |
| 804 | - } |
|
| 805 | - else |
|
| 803 | + } else |
|
| 806 | 804 | { |
| 807 | 805 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
| 808 | 806 | } |
@@ -815,10 +813,8 @@ discard block |
||
| 815 | 813 | if(!$term = term_exists(trim($data[0]['position']['destination']), 'location')) |
| 816 | 814 | { |
| 817 | 815 | $term = wp_insert_term(trim($data[0]['position']['destination']), 'location', $tax_args); |
| 818 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 819 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
| 820 | - } |
|
| 821 | - else |
|
| 816 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'location',true); } |
|
| 817 | + } else |
|
| 822 | 818 | { |
| 823 | 819 | wp_set_object_terms( $id, intval($term['term_id']), 'location',true); |
| 824 | 820 | } |
@@ -866,10 +862,8 @@ discard block |
||
| 866 | 862 | if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type')) |
| 867 | 863 | { |
| 868 | 864 | $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type'); |
| 869 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 870 | - else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
| 871 | - } |
|
| 872 | - else |
|
| 865 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); } |
|
| 866 | + } else |
|
| 873 | 867 | { |
| 874 | 868 | wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); |
| 875 | 869 | } |
@@ -928,14 +922,14 @@ discard block |
||
| 928 | 922 | |
| 929 | 923 | if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){ |
| 930 | 924 | $room_count = $data[0]['features']['rooms']; |
| 931 | - }else{ |
|
| 925 | + } else{ |
|
| 932 | 926 | $room_count = count($data[0]['rooms']); |
| 933 | 927 | } |
| 934 | 928 | |
| 935 | 929 | if(false !== $id && '0' !== $id){ |
| 936 | 930 | $prev_rooms = get_post_meta($id,'number_of_rooms',true); |
| 937 | 931 | update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms); |
| 938 | - }else{ |
|
| 932 | + } else{ |
|
| 939 | 933 | add_post_meta($id,'number_of_rooms',$room_count,true); |
| 940 | 934 | } |
| 941 | 935 | } |
@@ -948,7 +942,7 @@ discard block |
||
| 948 | 942 | |
| 949 | 943 | if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){ |
| 950 | 944 | $rating_type = $data[0]['features']['star_authority']; |
| 951 | - }else{ |
|
| 945 | + } else{ |
|
| 952 | 946 | $rating_type = 'Unspecified2'; |
| 953 | 947 | } |
| 954 | 948 | $this->save_custom_field($rating_type,'rating_type',$id); |
@@ -1078,10 +1072,8 @@ discard block |
||
| 1078 | 1072 | { |
| 1079 | 1073 | if(false !== $parent){ $parent = array('parent'=>$parent); } |
| 1080 | 1074 | $term = wp_insert_term(trim($name), $taxonomy,$parent); |
| 1081 | - if ( is_wp_error($term) ){echo $term->get_error_message();} |
|
| 1082 | - else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
| 1083 | - } |
|
| 1084 | - else |
|
| 1075 | + if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); } |
|
| 1076 | + } else |
|
| 1085 | 1077 | { |
| 1086 | 1078 | wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); |
| 1087 | 1079 | } |
@@ -1242,8 +1234,7 @@ discard block |
||
| 1242 | 1234 | if ( !empty( $filename) && " " != $filename ) |
| 1243 | 1235 | { |
| 1244 | 1236 | $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension |
| 1245 | - } |
|
| 1246 | - else |
|
| 1237 | + } else |
|
| 1247 | 1238 | { |
| 1248 | 1239 | $file_array['name'] = $url_filename; // just use original URL filename |
| 1249 | 1240 | } |
@@ -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" checked="<?php $this->checked($selected,$member); ?>" 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.'" checked="'.$this->checked($selected,$term->term_id).'" 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 | } |