Completed
Push — master ( 2939bf...29e8a9 )
by Warwick
02:39
created
classes/class-destination.php 1 patch
Braces   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 				if(isset($_POST['keyword'] )) {
322 322
 					$keyphrases = $_POST['keyword'];
323
-				}else{
323
+				} else{
324 324
 					$keyphrases = array(0);
325 325
                 }
326 326
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                             $searched_items[sanitize_title($row->name).'-'.$row->meta_value] = $this->format_row($row);
359 359
 
360 360
 
361
-						}else{
361
+						} else{
362 362
 							//Search through each keyword.
363 363
 							foreach($keyphrases as $keyphrase){
364 364
 
@@ -427,13 +427,13 @@  discard block
 block discarded – undo
427 427
 			$wetu_id = $_POST['wetu_id'];
428 428
 			if(isset($_POST['post_id'])){
429 429
 				$post_id = $_POST['post_id'];	
430
-			}else{
430
+			} else{
431 431
 				$post_id = 0;
432 432
 			}
433 433
 
434 434
 			if(isset($_POST['team_members'])){
435 435
 				$team_members = $_POST['team_members'];	
436
-			}else{
436
+			} else{
437 437
 				$team_members = false;
438 438
 			}
439 439
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 			if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){
443 443
 				$content = $_POST['content'];
444 444
 				add_option('wetu_importer_destination_settings',$content);
445
-			}else{
445
+			} else{
446 446
 				delete_option('wetu_importer_destination_settings');
447 447
 				$content = false;
448 448
 			}
@@ -482,10 +482,10 @@  discard block
 block discarded – undo
482 482
 		        if(isset($data[0]['content']['extended_description']))
483 483
 		        {
484 484
 		            $data_post_content = $data[0]['content']['extended_description'];
485
-		        }elseif(isset($data[0]['content']['general_description'])){
485
+		        } elseif(isset($data[0]['content']['general_description'])){
486 486
 		            $data_post_content = $data[0]['content']['general_description'];
487 487
 		            $content_used_general_description = true;
488
-		        }elseif(isset($data[0]['content']['teaser_description'])){
488
+		        } elseif(isset($data[0]['content']['teaser_description'])){
489 489
 		        	$data_post_content = $data[0]['content']['teaser_description'];
490 490
 		        }
491 491
 	        	$post['post_content'] = wp_strip_all_tags($data_post_content);
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 	        if(false !== $importable_content && in_array('excerpt',$importable_content)){
496 496
 		        if(isset($data[0]['content']['teaser_description'])){
497 497
 		        	$data_post_excerpt = $data[0]['content']['teaser_description'];
498
-		        }elseif(isset($data[0]['content']['extended_description'])){
498
+		        } elseif(isset($data[0]['content']['extended_description'])){
499 499
 					$data_post_excerpt = $data[0]['content']['extended_description'];
500
-				}elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){
500
+				} elseif(isset($data[0]['content']['general_description']) && false === $content_used_general_description){
501 501
 		            $data_post_excerpt = $data[0]['content']['general_description'];
502 502
 		        }	   
503 503
 		        $post['post_excerpt'] = $data_post_excerpt;     	
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	        	$id = wp_update_post($post);
514 514
 	        	$prev_date = get_post_meta($id,'lsx_wetu_modified_date',true);
515 515
 	        	update_post_meta($id,'lsx_wetu_modified_date',strtotime($data[0]['last_modified']),$prev_date);
516
-	        }else{
516
+	        } else{
517 517
 
518 518
 		        //Set the name
519 519
 		        if(isset($data[0]['name'])){
@@ -596,13 +596,13 @@  discard block
 block discarded – undo
596 596
 
597 597
 			if(isset($data[0]['position']['driving_latitude'])){
598 598
 				$latitude = $data[0]['position']['driving_latitude'];
599
-			}elseif(isset($data[0]['position']['latitude'])){
599
+			} elseif(isset($data[0]['position']['latitude'])){
600 600
 				$latitude = $data[0]['position']['latitude'];
601 601
 			}
602 602
 
603 603
 			if(isset($data[0]['position']['driving_longitude'])){
604 604
 				$longitude = $data[0]['position']['driving_longitude'];
605
-			}elseif(isset($data[0]['position']['longitude'])){
605
+			} elseif(isset($data[0]['position']['longitude'])){
606 606
 				$longitude = $data[0]['position']['longitude'];
607 607
 			}		
608 608
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 			if(false !== $id && '0' !== $id){
636 636
 	        	$prev = get_post_meta($id,'location',true);
637 637
 	        	update_post_meta($id,'location',$location_data,$prev);
638
-	        }else{
638
+	        } else{
639 639
 	        	add_post_meta($id,'location',$location_data,true);
640 640
 	        }
641 641
 		}
Please login to merge, or discard this patch.
classes/class-admin.php 1 patch
Braces   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -161,18 +161,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
classes/class-tours.php 1 patch
Braces   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 
250 250
 			if(true === $result){
251 251
 			    echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span>';
252
-            }else{
252
+            } else{
253 253
 			    echo '<span style="color:red;">'.wp_kses_post($result).'</span>';
254 254
             }
255
-		}else{
255
+		} else{
256 256
 			echo '<span style="color:green;">'.esc_attr('Connected','wetu-importer').'</span>';
257 257
         }
258 258
 		echo '</h3></div>';
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 		if(isset($tours['error'])){
269 269
 		    return $tours['error'];
270
-        }elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) {
270
+        } elseif (isset($tours['itineraries']) && !empty($tours['itineraries'])) {
271 271
 			set_transient('lsx_ti_tours',$tours['itineraries'],60*60*2);
272 272
 			return true;
273 273
 		}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 				if(isset($_POST['keyword'] )) {
316 316
 					$keyphrases = $_POST['keyword'];
317
-				}else{
317
+				} else{
318 318
 					$keyphrases = array(0);
319 319
                 }
320 320
 
@@ -366,16 +366,16 @@  discard block
 block discarded – undo
366 366
 
367 367
 								if(0 !== $row['post_id']){
368 368
 								    continue;
369
-								}else{
369
+								} else{
370 370
 									$searched_items[sanitize_title($row['name']).'-'.$row['identifier']] = $this->format_row($row);
371 371
                                 }
372 372
 
373 373
 
374
-                            }else{
374
+                            } else{
375 375
 
376 376
 								if(0 === $row['post_id']){
377 377
 									continue;
378
-								}else{
378
+								} else{
379 379
 									$current_status = get_post_status($row['post_id']);
380 380
 									if($current_status !== $post_status){
381 381
 									    continue;
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
                             }
388 388
 
389
-                        }else{
389
+                        } else{
390 390
 							//Search through each keyword.
391 391
 							foreach($keyphrases as $keyphrase){
392 392
 
@@ -455,14 +455,14 @@  discard block
 block discarded – undo
455 455
 			$wetu_id = $_POST['wetu_id'];
456 456
 			if(isset($_POST['post_id'])){
457 457
 				$post_id = $_POST['post_id'];	
458
-			}else{
458
+			} else{
459 459
 				$post_id = 0;
460 460
 			}
461 461
 
462 462
 			if(isset($_POST['content']) && is_array($_POST['content']) && !empty($_POST['content'])){
463 463
 				$content = $_POST['content'];
464 464
 				add_option('wetu_importer_tour_settings',$content);
465
-			}else{
465
+			} else{
466 466
 				delete_option('wetu_importer_tour_settings');
467 467
 				$content = false;
468 468
 			}
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
             if(isset($data['description'])){
504 504
                 $data_post_content = $data['description'];
505
-            }elseif(isset($data['summary'])){
505
+            } elseif(isset($data['summary'])){
506 506
                 $data_post_content = $data['summary'];
507 507
             }
508 508
             $post['post_content'] = $data_post_content;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
             $id = wp_update_post($post);
516 516
             $prev_date = get_post_meta($id,'lsx_wetu_modified_date',true);
517 517
             update_post_meta($id,'lsx_wetu_modified_date',strtotime($data['last_modified']),$prev_date);
518
-        }else{
518
+        } else{
519 519
 
520 520
             //Set the name
521 521
             if(isset($data['name'])){
@@ -626,42 +626,42 @@  discard block
 block discarded – undo
626 626
 						//Description
627 627
 						if(false !== $importable_content && in_array('itinerary_description',$importable_content) && isset($day['notes']) && '' !== $day['notes']){
628 628
 							$current_day['description'] = strip_tags($day['notes']);
629
-						}else{
629
+						} else{
630 630
 							$current_day['description'] = '';
631 631
 						}
632 632
 
633 633
 						//Itinerary Gallery
634 634
 						if(false !== $importable_content && in_array('itinerary_gallery',$importable_content) && isset($day['images'])){
635 635
 							$current_day['featured_image'] = '';
636
-						}else{
636
+						} else{
637 637
 							$current_day['featured_image'] = '';
638 638
 						}
639 639
 
640 640
 						//Accommodation
641 641
 						if(false !== $current_accommodation){
642 642
 							$current_day['accommodation_to_tour'] = array($current_accommodation);
643
-						}else{
643
+						} else{
644 644
 							$current_day['accommodation_to_tour'] = array();
645 645
 						}
646 646
 
647 647
 						//Destination
648 648
 						if(false !== $current_destination){
649 649
 							$current_day['destination_to_tour'] = array($current_destination);
650
-						}else{
650
+						} else{
651 651
 							$current_day['destination_to_tour'] = array();
652 652
 						}
653 653
 
654 654
 						//Included
655 655
 						if(false !== $importable_content && in_array('itinerary_included',$importable_content) && isset($day['included']) && '' !== $day['included']){
656 656
 							$current_day['included'] = strip_tags($day['included']);
657
-						}else{
657
+						} else{
658 658
 							$current_day['description'] = '';
659 659
 						}
660 660
 
661 661
 						//Excluded
662 662
 						if(false !== $importable_content && in_array('itinerary_excluded',$importable_content) && isset($day['excluded']) && '' !== $day['excluded']){
663 663
 							$current_day['excluded'] = strip_tags($day['excluded']);
664
-						}else{
664
+						} else{
665 665
 							$current_day['excluded'] = '';
666 666
 						}
667 667
 
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
 						$day_counter++;
670 670
 					}
671 671
 
672
-				}else{
672
+				} else{
673 673
 					$day_counter = $day_counter + (int)$leg['nights'];
674 674
 				}
675 675
 
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 
770 770
 			if(false !== $this->current_accommodation && !empty($this->current_accommodation) && array_key_exists($day['content_entity_id'],$this->current_accommodation)){
771 771
                 $ac_id = $this->current_accommodation[$day['content_entity_id']];
772
-			}else{
772
+			} else{
773 773
 				$ac_id = wp_insert_post(array(
774 774
                     'post_type' => 'accommodation',
775 775
                     'post_status' => 'draft',
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 					$this->set_country($country_wetu_id, $id);
837 837
                 }
838 838
 
839
-			}else {
839
+			} else {
840 840
 
841 841
 				$destination_json = file_get_contents("http://wetu.com/API/Pins/".$this->api_key."/Get?ids=" . $day['destination_content_entity_id']);
842 842
 
Please login to merge, or discard this patch.