Test Setup Failed
Pull Request — master (#217)
by Kiran
05:52
created
geodirectory_template_tags.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 {
38 38
     $is_detail_page = false;
39 39
 
40
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
40
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
41 41
         $is_detail_page = true;
42 42
     }
43 43
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53 53
         'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
54
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
55 55
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56 56
     );
57 57
 
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * }
74 74
      */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
75
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
76 76
 
77 77
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78 78
 
79
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
79
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
80
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
81 81
 
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
82
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
83 83
     wp_enqueue_script('geodirectory-lightbox-jquery');
84 84
 
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
85
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
86 86
     if ($is_detail_page) {
87 87
         wp_enqueue_script('geodirectory-jquery-simplemodal');
88 88
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     $map_extra = apply_filters('geodir_googlemap_script_extra', '');
100 100
     wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
101 101
     
102
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
102
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
103 103
     wp_enqueue_script('geodirectory-goMap-script');
104 104
 
105 105
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         wp_enqueue_script('plupload-all');
117 117
         wp_enqueue_script('jquery-ui-sortable');
118 118
 
119
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
119
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
120 120
         wp_enqueue_script('geodirectory-plupload-script');
121 121
         // SCRIPT FOR UPLOAD END
122 122
 
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_add_async_forscript($url)
231 231
 {
232
-    if (strpos($url, '#asyncload')===false)
232
+    if (strpos($url, '#asyncload') === false)
233 233
         return $url;
234 234
     else if (is_admin())
235 235
         return str_replace('#asyncload', '', $url);
236 236
     else
237
-        return str_replace('#asyncload', '', $url)."' async='async";
237
+        return str_replace('#asyncload', '', $url) . "' async='async";
238 238
 }
239 239
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
240 240
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 {
249 249
 
250 250
 
251
-    if(get_option('geodir_scss_core')) {
251
+    if (get_option('geodir_scss_core')) {
252 252
 
253 253
 
254 254
         wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
283 283
         wp_enqueue_style('geodir-chosen-style');
284 284
 
285
-    }else{
285
+    } else {
286 286
         wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
287 287
         wp_enqueue_style('geodir-core-scss');
288 288
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
     }
292 292
 
293
-    if(is_rtl()){
293
+    if (is_rtl()) {
294 294
     wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
295 295
     wp_enqueue_style('geodirectory-frontend-rtl-style');
296 296
     }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
                 $term_id = get_queried_object_id();
366 366
                 $taxonomy = get_query_var('taxonomy');
367 367
 
368
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
368
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category') {
369 369
                     $term = get_term($term_id, $post_type . 'category');
370 370
                 }
371 371
             }
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
                 $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
375 375
                 
376 376
                 if (!is_array($taxonomy_search)) {
377
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
378
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
379
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
377
+                    $term = get_term((int) $taxonomy_search, $post_type . 'category');
378
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
379
+                    $term = get_term((int) $taxonomy_search[0], $post_type . 'category');
380 380
                 }
381 381
             }
382 382
             
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         if ($max_page > 1 || $always_show) {            
389 389
             // Extra pagination info
390 390
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
391
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
391
+            $start_no = ($paged - 1) * $posts_per_page + 1;
392 392
             $end_no = min($paged * $posts_per_page, $numposts);
393 393
 
394 394
             if ($geodir_pagination_more_info != '') {
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
         jQuery(function ($) {
475 475
             $("#distance_slider").slider({
476 476
                 range: true,
477
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
477
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
478 478
                 min: 0,
479 479
                 max: <?php echo $dist; ?>,
480 480
                 step: <?php echo $dist_dif; ?>,
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 
540 540
 
541 541
     <script type="text/javascript">
542
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
542
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
543 543
         var latlng;
544 544
         var Sgeocoder;
545 545
         var address;
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 				var $form = jQuery(this).closest('form');
553 553
 				
554 554
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
555
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
555
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
556 556
 				
557 557
 				// Disable location based search for disabled location post type.
558 558
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 					}
567 567
 				}
568 568
 				
569
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
569
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
570 570
 					geodir_setsearch($form);
571 571
 				} else {
572 572
 					jQuery(".snear", $form).val('');
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 		});
587 587
         
588 588
 		function geodir_setsearch($form) {
589
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
589
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
590 590
 			geocodeAddress($form);
591 591
 		}
592 592
 
@@ -599,8 +599,8 @@  discard block
 block discarded – undo
599 599
         function geocodeAddress($form) {
600 600
             Sgeocoder = new google.maps.Geocoder(); // Call the geocode function
601 601
 
602
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
603
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
602
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
603
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
604 604
                     jQuery(".snear", $form).val('');
605 605
                 }
606 606
                 jQuery($form).submit();
@@ -608,24 +608,24 @@  discard block
 block discarded – undo
608 608
 
609 609
                 var address = jQuery(".snear", $form).val();
610 610
 
611
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
611
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
612 612
                     initialise2();
613 613
                 } else {
614 614
 
615 615
                     Sgeocoder.geocode({'address': address<?php
616
-                    if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
617
-                    if($near_add2 =
616
+                    if ($near_add = get_option('geodir_search_near_addition')) {echo '+", ' . $near_add . '"'; }
617
+                    if ($near_add2 =
618 618
                     /**
619 619
                      * Adds any extra info to the near search box query when trying to geolocate it via google api.
620 620
                      *
621 621
                      * @since 1.0.0
622 622
                      */
623
-                    apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
623
+                    apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>},
624 624
                         function (results, status) {
625 625
                             if (status == google.maps.GeocoderStatus.OK) {
626 626
                                 updateSearchPosition(results[0].geometry.location, $form);
627 627
                             } else {
628
-                                alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status);
628
+                                alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
629 629
                             }
630 630
                         });
631 631
                 }
@@ -656,19 +656,19 @@  discard block
 block discarded – undo
656 656
             var msg;
657 657
             switch (err.code) {
658 658
                 case err.UNKNOWN_ERROR:
659
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
659
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
660 660
                     break;
661 661
                 case err.PERMISSION_DENINED:
662
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
662
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
663 663
                     break;
664 664
                 case err.POSITION_UNAVAILABLE:
665
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
665
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
666 666
                     break;
667 667
                 case err.BREAK:
668
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
668
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
669 669
                     break;
670 670
                 default:
671
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
671
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
672 672
             }
673 673
             jQuery('#info').html(msg);
674 674
         }
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
              * @param object $post The post object.
710 710
              * @param string $link The link to the post.
711 711
              */
712
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
712
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
713 713
             break;
714 714
         case 'new' :
715 715
             /**
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
              * @param object $post The post object.
720 720
              * @param string $link The link to the post.
721 721
              */
722
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
722
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
723 723
             break;
724 724
 
725 725
     }
Please login to merge, or discard this patch.