Test Failed
Pull Request — master (#445)
by Kiran
23:18
created
geodirectory-functions/shortcode_functions.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
             $value = 100;
30 30
         }
31 31
         // Re-add the percent symbol
32
-        $value = $value . '%';
32
+        $value = $value.'%';
33 33
     } elseif ((strlen($value) - 2) == strpos(trim($value), 'px')) {
34 34
         // Get the absint & re-add the 'px'
35
-        $value = preg_replace('/\D/', '', $value) . 'px';
35
+        $value = preg_replace('/\D/', '', $value).'px';
36 36
     } else {
37 37
         $value = preg_replace('/\D/', '', $value);
38 38
     }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     }
212 212
     if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
213 213
 
214
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
214
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
215 215
 
216 216
         add_filter('posts_fields', 'geodir_posts_fields', 1);
217 217
         add_filter('posts_join', 'geodir_posts_join', 1);
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
     }
489 489
 
490 490
     if (!empty($post_type)) {
491
-        $table = $plugin_prefix . $post_type . '_detail';
491
+        $table = $plugin_prefix.$post_type.'_detail';
492 492
         
493 493
         if (!geodir_prepare_custom_sorting($sort_choice, $table)) {
494 494
             $sort_choice = '';
@@ -581,10 +581,10 @@  discard block
 block discarded – undo
581 581
 	$add_location_filter = !empty($args['add_location_filter']) ? true : false;
582 582
 	$list_sort 			 = !empty($args['list_sort']) ? $args['list_sort'] : 'latest';
583 583
 	$character_count	 = isset($args['character_count']) ? $args['character_count'] : '';
584
-	$layout 			 = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf';
584
+	$layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf';
585 585
 	$listing_width 		 = !empty($args['listing_width']) ? $args['listing_width'] : '';
586
-	$with_pagination 	 = !empty($args['with_pagination']) ? true : false;
587
-	$event_type 	 	 = !empty($args['event_type']) ? $args['event_type'] : '';
586
+	$with_pagination = !empty($args['with_pagination']) ? true : false;
587
+	$event_type = !empty($args['event_type']) ? $args['event_type'] : '';
588 588
     $shortcode_content   = !empty($args['shortcode_content']) ? trim($args['shortcode_content']) : '';
589 589
     $tags                = !empty($args['tags']) ? $args['tags'] : array();
590 590
     /**
@@ -598,13 +598,13 @@  discard block
 block discarded – undo
598 598
     $shortcode_content = apply_filters('geodir_sc_gd_listings_not_found_content', $shortcode_content, $args);
599 599
 		
600 600
 	$top_pagination 	 = $with_pagination && !empty($args['top_pagination']) ? true : false;
601
-	$bottom_pagination 	 = $with_pagination && !empty($args['bottom_pagination']) ? true : false;
601
+	$bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false;
602 602
 	
603 603
 	$shortcode_atts		 = !empty($args['shortcode_atts']) ? $args['shortcode_atts'] : array();
604 604
 
605 605
 	// ajax mode
606
-	$geodir_ajax		 = !empty($args['geodir_ajax']) ? true : false;
607
-	$pageno 	 		 = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1;
606
+	$geodir_ajax = !empty($args['geodir_ajax']) ? true : false;
607
+	$pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1;
608 608
 	
609 609
 	$query_args = array(
610 610
         'posts_per_page' => $post_number,
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
         // Clean tags
669 669
         if (!is_array($tags)) {
670 670
             $comma = _x(',', 'tag delimiter');
671
-            if ( ',' !== $comma ) {
671
+            if (',' !== $comma) {
672 672
                 $tags = str_replace($comma, ',', $tags);
673 673
             }
674 674
             $tags = explode(',', trim($tags, " \n\t\r\0\x0B,"));
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         
678 678
         if (!empty($tags)) {
679 679
             $tag_query = array(
680
-                'taxonomy' => $post_type . '_tags',
680
+                'taxonomy' => $post_type.'_tags',
681 681
                 'field' => 'name',
682 682
                 'terms' => $tags
683 683
             );
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		$widget_listings = $total_posts > 0 ? geodir_get_widget_listings($query_args) : array();
708 708
 	}
709 709
 	$current_gridview_columns_widget = $gridview_columns_widget;
710
-    $identifier = ' gd-wgt-pagi-' . mt_rand();
710
+    $identifier = ' gd-wgt-pagi-'.mt_rand();
711 711
     ob_start();
712 712
 	if (!empty($widget_listings) || $with_no_results) {
713 713
 		if (!$geodir_ajax) {
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
          */
719 719
         do_action('geodir_before_sc_gd_listings');
720 720
 		?>
721
-        <div class="geodir_locations geodir_location_listing geodir-sc-gd-listings <?php echo $identifier;?>">
721
+        <div class="geodir_locations geodir_location_listing geodir-sc-gd-listings <?php echo $identifier; ?>">
722 722
             <?php if ($title != '') { ?>
723 723
             <div class="geodir_list_heading clearfix">
724 724
                 <?php echo $title; ?>
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
 			?>
788 788
             </div><p class="geodir-sclisting-loading" style="display:none;"><i class="fa fa-cog fa-spin"></i></p></div>
789 789
 <script type="text/javascript">
790
-jQuery(document).on('click', '.<?php echo trim($identifier);?> .gd-wgt-page', function(e) {
791
-    var container = jQuery( '.<?php echo trim($identifier);?>');
790
+jQuery(document).on('click', '.<?php echo trim($identifier); ?> .gd-wgt-page', function(e) {
791
+    var container = jQuery( '.<?php echo trim($identifier); ?>');
792 792
     var obj = this;
793 793
     var pid = parseInt(jQuery(this).data('page'));
794 794
     var items = jQuery(obj).closest('.gd-sc-content');
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
         return false;
799 799
     }
800 800
     
801
-    var scatts = "<?php echo addslashes(json_encode($shortcode_atts));?>";
801
+    var scatts = "<?php echo addslashes(json_encode($shortcode_atts)); ?>";
802 802
     
803 803
     var data = {
804 804
       'action': 'geodir_sclistings',
@@ -887,16 +887,16 @@  discard block
 block discarded – undo
887 887
 	if ($max_page > 1 || $always_show) {
888 888
 		// Extra pagination info
889 889
 		$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
890
-		$start_no = ( $pageno - 1 ) * $posts_per_page + 1;
890
+		$start_no = ($pageno - 1) * $posts_per_page + 1;
891 891
 		$end_no = min($pageno * $posts_per_page, $numposts);
892 892
 		
893 893
 		if ($geodir_pagination_more_info != '') {
894
-			$pagination_info = '<div class="gd-pagination-details gd-pagination-details-' . $geodir_pagination_more_info . '">' . wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts) . '</div>';
894
+			$pagination_info = '<div class="gd-pagination-details gd-pagination-details-'.$geodir_pagination_more_info.'">'.wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts).'</div>';
895 895
 			
896 896
 			if ($geodir_pagination_more_info == 'before') {
897
-				$before = $before . $pagination_info;
897
+				$before = $before.$pagination_info;
898 898
 			} else if ($geodir_pagination_more_info == 'after') {
899
-				$after = $pagination_info . $after;
899
+				$after = $pagination_info.$after;
900 900
 			}
901 901
 		}
902 902
 			
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 		}
907 907
 		
908 908
 		if (($pageno - 1) > 0) {
909
-            echo '<a class="gd-page-sc-prev gd-wgt-page" data-page="' . (int)($pageno - 1) . '" href="javascript:void(0);">' . $prelabel . '</a>&nbsp;';
909
+            echo '<a class="gd-page-sc-prev gd-wgt-page" data-page="'.(int) ($pageno - 1).'" href="javascript:void(0);">'.$prelabel.'</a>&nbsp;';
910 910
 		}
911 911
 		
912 912
 		for ($i = $pageno - $half_pages_to_show; $i <= $pageno + $half_pages_to_show; $i++) {
@@ -914,17 +914,17 @@  discard block
 block discarded – undo
914 914
 				if ($i == $pageno) {
915 915
 					echo "<strong class='on' class='gd-page-sc-act'>$i</strong>";
916 916
 				} else {
917
-					echo ' <a class="gd-page-sc-no gd-wgt-page" data-page="' . (int)$i . '" href="javascript:void(0);">' . $i . '</a> ';
917
+					echo ' <a class="gd-page-sc-no gd-wgt-page" data-page="'.(int) $i.'" href="javascript:void(0);">'.$i.'</a> ';
918 918
 				}
919 919
 			}
920 920
 		}
921 921
 		
922 922
 		if (($pageno + 1) <= $max_page) {
923
-			echo '&nbsp;<a class="gd-page-sc-nxt gd-wgt-page" data-page="' . (int)($pageno + 1) . '" href="javascript:void(0);">' . $nxtlabel . '</a>';
923
+			echo '&nbsp;<a class="gd-page-sc-nxt gd-wgt-page" data-page="'.(int) ($pageno + 1).'" href="javascript:void(0);">'.$nxtlabel.'</a>';
924 924
 		}
925 925
 		
926 926
 		if ($pageno < $max_page) {
927
-			echo '&nbsp;<a class="gd-page-sc-lst gd-wgt-page" data-page="' . (int)$max_page . '" href="javascript:void(0);">&raquo;</a>';
927
+			echo '&nbsp;<a class="gd-page-sc-lst gd-wgt-page" data-page="'.(int) $max_page.'" href="javascript:void(0);">&raquo;</a>';
928 928
 		}
929 929
 		echo "</div> $after </div>";
930 930
 	}
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
     $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL;
948 948
     $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1;
949 949
 	
950
-	$shortcode_atts = !empty($scatts) ? (array)json_decode(stripslashes_deep($scatts)) : NULL;
950
+	$shortcode_atts = !empty($scatts) ? (array) json_decode(stripslashes_deep($scatts)) : NULL;
951 951
 	
952 952
 	if (!empty($shortcode_atts) && is_array($shortcode_atts)) {
953 953
 		$shortcode_atts['pageno'] = $pageno;
Please login to merge, or discard this patch.