Completed
Push — master ( ef4c1a...1aafd8 )
by Warwick
07:18
created
classes/class-connect-accommodation.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
classes/lsx-banners-integration.php 1 patch
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
classes/class-accommodation.php 1 patch
Braces   +19 added lines, -21 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,16 +306,16 @@  discard block
 block discarded – undo
306 306
 
307 307
 								if(0 !== $row['post_id']){
308 308
 									continue;
309
-								}else{
309
+								} else{
310 310
 									$searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row);
311 311
 								}
312 312
 
313 313
 
314
-							}else{
314
+							} else{
315 315
 
316 316
 								if(0 === $row['post_id']){
317 317
 									continue;
318
-								}else{
318
+								} else{
319 319
 									$current_status = get_post_status($row['post_id']);
320 320
 									if($current_status !== $post_status){
321 321
 										continue;
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 								$searched_items[sanitize_title($row['name']).'-'.$row['id']] = $this->format_row($row);
326 326
 							}
327 327
 
328
-						}else{
328
+						} else{
329 329
 							//Search through each keyword.
330 330
 							foreach($keyphrases as $keyphrase){
331 331
 
@@ -395,19 +395,19 @@  discard block
 block discarded – undo
395 395
 			$wetu_id = $_POST['wetu_id'];
396 396
 			if(isset($_POST['post_id'])){
397 397
 				$post_id = $_POST['post_id'];	
398
-			}else{
398
+			} else{
399 399
 				$post_id = 0;
400 400
 			}
401 401
 
402 402
 			if(isset($_POST['team_members'])){
403 403
 				$team_members = $_POST['team_members'];	
404
-			}else{
404
+			} else{
405 405
 				$team_members = false;
406 406
 			}
407 407
 
408 408
 			if(isset($_POST['safari_brands'])){
409 409
 				$safari_brands = $_POST['safari_brands'];	
410
-			}else{
410
+			} else{
411 411
 				$safari_brands = false;
412 412
 			}
413 413
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 			if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){
416 416
 				$content = $_POST['content'];
417 417
 				add_option('wetu_importer_accommodation_settings',$content);
418
-			}else{
418
+			} else{
419 419
 
420 420
 				$content = false;
421 421
 			}
@@ -453,10 +453,10 @@  discard block
 block discarded – undo
453 453
 		        if(isset($data[0]['content']['extended_description']))
454 454
 		        {
455 455
 		            $data_post_content = $data[0]['content']['extended_description'];
456
-		        }elseif(isset($data[0]['content']['general_description'])){
456
+		        } elseif(isset($data[0]['content']['general_description'])){
457 457
 		            $data_post_content = $data[0]['content']['general_description'];
458 458
 		            $content_used_general_description = true;
459
-		        }elseif(isset($data[0]['content']['teaser_description'])){
459
+		        } elseif(isset($data[0]['content']['teaser_description'])){
460 460
 		        	$data_post_content = $data[0]['content']['teaser_description'];
461 461
 		        }
462 462
 	        	$post['post_content'] = wp_strip_all_tags($data_post_content);
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 	        if(false !== $importable_content && in_array('excerpt',$importable_content)){
467 467
 		        if(isset($data[0]['content']['teaser_description'])){
468 468
 		        	$data_post_excerpt = $data[0]['content']['teaser_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
 block discarded – undo
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'])){
@@ -646,10 +646,8 @@  discard block
 block discarded – undo
646 646
 			if(!$term = term_exists(trim($data[0]['category']), 'accommodation-type'))
647 647
 	        {
648 648
 	            $term = wp_insert_term(trim($data[0]['category']), 'accommodation-type');
649
-	            if ( is_wp_error($term) ){echo $term->get_error_message();}
650
-	            else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); }
651
-	        }
652
-	        else
649
+	            if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true); }
650
+	        } else
653 651
 	        {
654 652
 	            wp_set_object_terms( $id, intval($term['term_id']), 'accommodation-type',true);
655 653
 	        }				
@@ -708,14 +706,14 @@  discard block
 block discarded – undo
708 706
 
709 707
 			if(isset($data[0]['features']) && isset($data[0]['features']['rooms'])){
710 708
 				$room_count = $data[0]['features']['rooms'];
711
-			}else{
709
+			} else{
712 710
 				$room_count = count($data[0]['rooms']);
713 711
 			}
714 712
 
715 713
 			if(false !== $id && '0' !== $id){
716 714
 	        	$prev_rooms = get_post_meta($id,'number_of_rooms',true);
717 715
 	        	update_post_meta($id,'number_of_rooms',$room_count,$prev_rooms);
718
-	        }else{
716
+	        } else{
719 717
 	        	add_post_meta($id,'number_of_rooms',$room_count,true);
720 718
 	        }
721 719
 		}
@@ -728,7 +726,7 @@  discard block
 block discarded – undo
728 726
 
729 727
 		if(!empty($data[0]['features']) && isset($data[0]['features']['star_authority'])){
730 728
 			$rating_type = $data[0]['features']['star_authority'];	
731
-		}else{
729
+		} else{
732 730
 			$rating_type = 'Unspecified2';
733 731
 		}
734 732
 		$this->save_custom_field($rating_type,'rating_type',$id);
Please login to merge, or discard this patch.
classes/class-tours.php 1 patch
Braces   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
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>';
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 		if(isset($tours['error'])){
322 322
 		    return $tours['error'];
323
-        }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) {
323
+        } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) {
324 324
 			set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2);
325 325
 			return true;
326 326
 		}
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 
370 370
 				if(isset($_POST['keyword'] )) {
371 371
 					$keyphrases = $_POST['keyword'];
372
-				}else{
372
+				} else{
373 373
 					$keyphrases = array(0);
374 374
 				}
375 375
 
@@ -421,16 +421,16 @@  discard block
 block discarded – undo
421 421
 
422 422
 								if(0 !== $row['post_id']){
423 423
 									continue;
424
-								}else{
424
+								} else{
425 425
 									$searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row);
426 426
 								}
427 427
 
428 428
 
429
-							}else{
429
+							} else{
430 430
 
431 431
 								if(0 === $row['post_id']){
432 432
 									continue;
433
-								}else{
433
+								} else{
434 434
 									$current_status = get_post_status($row['post_id']);
435 435
 									if($current_status !== $post_status){
436 436
 										continue;
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 
442 442
 							}
443 443
 
444
-						}else{
444
+						} else{
445 445
 							//Search through each keyword.
446 446
 							foreach($keyphrases as $keyphrase){
447 447
 
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			$wetu_id = $_POST['wetu_id'];
512 512
 			if(isset($_POST['post_id'])){
513 513
 				$post_id = $_POST['post_id'];	
514
-			}else{
514
+			} else{
515 515
 				$post_id = 0;
516 516
 			}
517 517
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 			if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){
520 520
 				$content = $_POST['content'];
521 521
 				add_option('wetu_importer_tour_settings',$content);
522
-			}else{
522
+			} else{
523 523
 				$content = false;
524 524
 			}
525 525
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 
559 559
             if(isset($data['description'])){
560 560
                 $data_post_content = $data['description'];
561
-            }elseif(isset($data['summary'])){
561
+            } elseif(isset($data['summary'])){
562 562
                 $data_post_content = $data['summary'];
563 563
             }
564 564
             $post['post_content'] = $data_post_content;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
             $id = wp_update_post($post);
572 572
             $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true);
573 573
             update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date);
574
-        }else{
574
+        } else{
575 575
 
576 576
             //Set the name
577 577
             if(isset($data['name'])){
@@ -662,42 +662,42 @@  discard block
 block discarded – undo
662 662
 						//Description
663 663
 						if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes'])){
664 664
 							$current_day['description'] = $day['notes'];
665
-						}else{
665
+						} else{
666 666
 							$current_day['description'] = '';
667 667
 						}
668 668
 
669 669
 						//Itinerary Gallery
670 670
 						if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){
671 671
 							$current_day['featured_image'] = '';
672
-						}else{
672
+						} else{
673 673
 							$current_day['featured_image'] = '';
674 674
 						}
675 675
 
676 676
 						//Accommodation
677 677
 						if(false !== $current_accommodation){
678 678
 							$current_day['accommodation_to_tour'] = array($current_accommodation);
679
-						}else{
679
+						} else{
680 680
 							$current_day['accommodation_to_tour'] = array();
681 681
 						}
682 682
 
683 683
 						//Destination
684 684
 						if(false !== $current_destination){
685 685
 							$current_day['destination_to_tour'] = array($current_destination);
686
-						}else{
686
+						} else{
687 687
 							$current_day['destination_to_tour'] = array();
688 688
 						}
689 689
 
690 690
 						//Included
691 691
 						if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){
692 692
 							$current_day['included'] = $day['included'];
693
-						}else{
693
+						} else{
694 694
 							$current_day['included'] = '';
695 695
 						}
696 696
 
697 697
 						//Excluded
698 698
 						if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){
699 699
 							$current_day['excluded'] = $day['excluded'];
700
-						}else{
700
+						} else{
701 701
 							$current_day['excluded'] = '';
702 702
 						}
703 703
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 						$day_counter++;
706 706
 					}
707 707
 
708
-				}else{
708
+				} else{
709 709
 					$day_counter = $day_counter + (int)$leg['nights'];
710 710
 				}
711 711
 
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 
819 819
 			if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){
820 820
                 $ac_id = $this->current_accommodation[$day['content_entity_id']];
821
-			}else{
821
+			} else{
822 822
 				$ac_id = wp_insert_post(array(
823 823
                     'post_type' => 'accommodation',
824 824
                     'post_status' => 'draft',
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 					$country_id = $this->set_country($country_wetu_id, $id);
887 887
                 }
888 888
 
889
-			}else {
889
+			} else {
890 890
 
891 891
 				$destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']);
892 892
 
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 				if(0 !== $country_id && false !== $country_id){
941 941
                     $this->relation_meta[$dest_id] = $country_id;
942 942
 					$this->relation_meta[$country_id] = 0;
943
-                }else{
943
+                } else{
944 944
 					$this->relation_meta[$dest_id] = 0;
945 945
                 }
946 946
 			}
Please login to merge, or discard this patch.
classes/class-importer.php 1 patch
Braces   +16 added lines, -22 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			if(isset($_GET['tab']) || isset($_POST['type'])) {
217 217
 				if(isset($_GET['tab'])) {
218 218
 					$this->tab_slug = $_GET['tab'];
219
-				}else{
219
+				} else{
220 220
 					$this->tab_slug = $_POST['type'];
221 221
 				}
222 222
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					<?php } ?>
394 394
                 </ul>
395 395
 				<?php
396
-			}else{
396
+			} else{
397 397
 			   $this->current_importer->display_page();
398 398
             }; ?>
399 399
         </div>
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 					foreach($team_members->posts as $member){ ?>
515 515
                         <li><input class="team" <?php $this->checked($selected,$member); ?> type="checkbox" value="<?php echo $member; ?>" /> <?php echo get_the_title($member); ?></li>
516 516
 					<?php }
517
-				}else{ ?>
517
+				} else{ ?>
518 518
                     <li><input class="team" type="checkbox" value="0" /> <?php _e('None','wetu-importer'); ?></li>
519 519
 				<?php }
520 520
 				?>
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 			if (in_array($needle, $haystack)) {
580 580
 				if(true === $wrap || 'true' === $wrap) {
581 581
 					$html = $type . '="' . $type . '"';
582
-				}else{
582
+				} else{
583 583
 					$html = $type;
584 584
 				}
585 585
 			}
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 
632 632
 			if(false !== $id && '0' !== $id && false !== $prev && true === $unique){
633 633
 				update_post_meta($id,$meta_key,$value,$prev);
634
-			}else{
634
+			} else{
635 635
 				add_post_meta($id,$meta_key,$value,$unique);
636 636
 			}
637 637
 		}
@@ -672,18 +672,15 @@  discard block
 block discarded – undo
672 672
 						if ( is_wp_error($term) )
673 673
 						{
674 674
 							echo $term->get_error_message();
675
-						}
676
-						else
675
+						} else
677 676
 						{
678 677
 							wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true);
679 678
 						}
680
-					}
681
-					else
679
+					} else
682 680
 					{
683 681
 						wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true);
684 682
 					}
685
-				}
686
-				else
683
+				} else
687 684
 				{
688 685
 					$result[]=trim($k);
689 686
 				}
@@ -697,10 +694,8 @@  discard block
 block discarded – undo
697 694
 		{
698 695
 			if(false !== $parent){ $parent = array('parent'=>$parent); }
699 696
 			$term = wp_insert_term(trim($name), $taxonomy,$parent);
700
-			if ( is_wp_error($term) ){echo $term->get_error_message();}
701
-			else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); }
702
-		}
703
-		else
697
+			if ( is_wp_error($term) ){echo $term->get_error_message();} else { wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true); }
698
+		} else
704 699
 		{
705 700
 			wp_set_object_terms( $id, intval($term['term_id']), $taxonomy,true);
706 701
 		}
@@ -720,7 +715,7 @@  discard block
 block discarded – undo
720 715
 				foreach($terms as $term){
721 716
 					$return .= '<li><input class="'.$taxonomy.'" '.$this->checked($selected,$term->term_id,false).' type="checkbox" value="'.$term->term_id.'" /> '.$term->name.'</li>';
722 717
 				}
723
-			}else{
718
+			} else{
724 719
 				$return .= '<li><input type="checkbox" value="" /> '.__('None','wetu-importer').'</li>';
725 720
 			}
726 721
 			$return .= '</ul>';
@@ -739,13 +734,13 @@  discard block
 block discarded – undo
739 734
 
740 735
 			if(isset($data[0]['position']['driving_latitude'])){
741 736
 				$latitude = $data[0]['position']['driving_latitude'];
742
-			}elseif(isset($data[0]['position']['latitude'])){
737
+			} elseif(isset($data[0]['position']['latitude'])){
743 738
 				$latitude = $data[0]['position']['latitude'];
744 739
 			}
745 740
 
746 741
 			if(isset($data[0]['position']['driving_longitude'])){
747 742
 				$longitude = $data[0]['position']['driving_longitude'];
748
-			}elseif(isset($data[0]['position']['longitude'])){
743
+			} elseif(isset($data[0]['position']['longitude'])){
749 744
 				$longitude = $data[0]['position']['longitude'];
750 745
 			}
751 746
 
@@ -777,7 +772,7 @@  discard block
 block discarded – undo
777 772
 			if(false !== $id && '0' !== $id){
778 773
 				$prev = get_post_meta($id,'location',true);
779 774
 				update_post_meta($id,'location',$location_data,$prev);
780
-			}else{
775
+			} else{
781 776
 				add_post_meta($id,'location',$location_data,true);
782 777
 			}
783 778
 		}
@@ -973,8 +968,7 @@  discard block
 block discarded – undo
973 968
 		if ( !empty( $filename) && " " != $filename )
974 969
 		{
975 970
 			$file_array['name'] = $filename . "." . $url_type['ext'];                           // user given filename for title, add original URL extension
976
-		}
977
-		else
971
+		} else
978 972
 		{
979 973
 			$file_array['name'] = $url_filename;                                                // just use original URL filename
980 974
 		}
@@ -1047,7 +1041,7 @@  discard block
 block discarded – undo
1047 1041
 		}
1048 1042
 		if(false !== $found && $needle_count === count($found)){
1049 1043
 			return true;
1050
-		}else{
1044
+		} else{
1051 1045
 			return false;
1052 1046
 		}
1053 1047
 	}
Please login to merge, or discard this patch.