Passed
Pull Request — master (#261)
by Viruthagiri
09:40
created
geodirectory_template_tags.php 3 patches
Braces   +37 added lines, -19 removed lines patch added patch discarded remove patch
@@ -245,13 +245,14 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
249
-        return $url;
250
-    else if (is_admin())
251
-        return str_replace('#asyncload', '', $url);
252
-    else
253
-        return str_replace('#asyncload', '', $url)."' async='async";
254
-}
248
+    if (strpos($url, '#asyncload')===false) {
249
+            return $url;
250
+    } else if (is_admin()) {
251
+            return str_replace('#asyncload', '', $url);
252
+    } else {
253
+            return str_replace('#asyncload', '', $url)."' async='async";
254
+    }
255
+    }
255 256
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
256 257
 
257 258
 /**
@@ -318,8 +319,10 @@  discard block
 block discarded – undo
318 319
 
319 320
     $half_pages_to_show = round($pages_to_show / 2);
320 321
 
321
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
322
-        return;
322
+    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) {
323
+    	// dont apply default  pagination for geodirectory home page.
324
+        return;
325
+    }
323 326
 
324 327
     if (!is_single()) {
325 328
         if (function_exists('geodir_location_geo_home_link')) {
@@ -439,11 +442,21 @@  discard block
 block discarded – undo
439 442
     }
440 443
     $dist_dif = 1000;
441 444
 
442
-    if ($dist <= 5000) $dist_dif = 500;
443
-    if ($dist <= 1000) $dist_dif = 100;
444
-    if ($dist <= 500) $dist_dif = 50;
445
-    if ($dist <= 100) $dist_dif = 10;
446
-    if ($dist <= 50) $dist_dif = 5;
445
+    if ($dist <= 5000) {
446
+    	$dist_dif = 500;
447
+    }
448
+    if ($dist <= 1000) {
449
+    	$dist_dif = 100;
450
+    }
451
+    if ($dist <= 500) {
452
+    	$dist_dif = 50;
453
+    }
454
+    if ($dist <= 100) {
455
+    	$dist_dif = 10;
456
+    }
457
+    if ($dist <= 50) {
458
+    	$dist_dif = 5;
459
+    }
447 460
 
448 461
     ?>
449 462
     <script type="text/javascript">
@@ -505,18 +518,23 @@  discard block
 block discarded – undo
505 518
 {
506 519
 
507 520
     $default_search_for_text = SEARCH_FOR_TEXT;
508
-    if (get_option('geodir_search_field_default_text'))
509
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
521
+    if (get_option('geodir_search_field_default_text')) {
522
+            $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
523
+    }
510 524
 
511 525
     $default_near_text = NEAR_TEXT;
512
-    if (get_option('geodir_near_field_default_text'))
513
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
526
+    if (get_option('geodir_near_field_default_text')) {
527
+            $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
528
+    }
514 529
 
515 530
     ?>
516 531
 
517 532
 
518 533
     <script type="text/javascript">
519
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
534
+        var default_location = '<?php if($search_location = geodir_get_default_location()) {
535
+	echo $search_location->city ;
536
+}
537
+?>';
520 538
         var latlng;
521 539
         var address;
522 540
         var dist = 0;
Please login to merge, or discard this patch.
Indentation   +322 added lines, -322 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function geodir_core_dequeue_script()
24 24
 {
25
-    wp_dequeue_script('flexslider');
25
+	wp_dequeue_script('flexslider');
26 26
 }
27 27
 
28 28
 add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
@@ -35,160 +35,160 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_templates_scripts()
37 37
 {
38
-    $is_detail_page = false;
39
-    $geodir_map_name = geodir_map_name();
40
-
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
-        $is_detail_page = true;
43
-    }
44
-
45
-    wp_enqueue_script('jquery');
46
-
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
-    wp_enqueue_script('geodirectory-script');
49
-
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
-        'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
-    );
58
-
59
-    /**
60
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
-     *
62
-     * This is used by addons to add JS translatable variables.
63
-     *
64
-     * @since 1.4.4
65
-     * @param array $geodir_vars_data {
66
-     *    geodir var data used by addons to add JS translatable variables.
67
-     *
68
-     *    @type string $siteurl Site url.
69
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
-     *    @type int $is_rtl Checks if current locale is RTL.
73
-     *
74
-     * }
75
-     */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
-
78
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
-
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
-
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    wp_enqueue_script('geodirectory-lightbox-jquery');
85
-
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    if ($is_detail_page) {
88
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
89
-    }
90
-
91
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
94
-        /**
95
-         * Filter the variables that are added to the end of the google maps script call.
96
-         *
97
-         * This i used to change things like google maps language etc.
98
-         *
99
-         * @since 1.0.0
100
-         * @param string $var The string to filter, default is empty string.
101
-         */
102
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
-    }
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40
+
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
44
+
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
+	wp_enqueue_script('geodirectory-script');
49
+
50
+	$geodir_vars_data = array(
51
+		'siteurl' => get_option('siteurl'),
52
+		'geodir_plugin_url' => geodir_plugin_url(),
53
+		'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
+		'geodir_ajax_url' => geodir_get_ajax_url(),
55
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
+	);
58
+
59
+	/**
60
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
+	 *
62
+	 * This is used by addons to add JS translatable variables.
63
+	 *
64
+	 * @since 1.4.4
65
+	 * @param array $geodir_vars_data {
66
+	 *    geodir var data used by addons to add JS translatable variables.
67
+	 *
68
+	 *    @type string $siteurl Site url.
69
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
+	 *    @type int $is_rtl Checks if current locale is RTL.
73
+	 *
74
+	 * }
75
+	 */
76
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
+
78
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
+
80
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
+
83
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	wp_enqueue_script('geodirectory-lightbox-jquery');
85
+
86
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	if ($is_detail_page) {
88
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
89
+	}
90
+
91
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
92
+		$map_lang = "&language=" . geodir_get_map_default_language();
93
+		$map_key = "&key=" . geodir_get_map_api_key();
94
+		/**
95
+		 * Filter the variables that are added to the end of the google maps script call.
96
+		 *
97
+		 * This i used to change things like google maps language etc.
98
+		 *
99
+		 * @since 1.0.0
100
+		 * @param string $var The string to filter, default is empty string.
101
+		 */
102
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
+		wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
+	}
105 105
     
106
-    if ($geodir_map_name == 'osm') {
107
-        // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
-        wp_enqueue_style('geodirectory-leaflet-style');
106
+	if ($geodir_map_name == 'osm') {
107
+		// Leaflet OpenStreetMap
108
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
+		wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
-        wp_enqueue_script('geodirectory-leaflet-script');
111
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
+		wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
116
-    }
117
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
114
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
116
+	}
117
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
118 118
     
119
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
120
-    wp_enqueue_script('geodirectory-goMap-script');
121
-
122
-
123
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
124
-    wp_enqueue_script('chosen');
125
-
126
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
127
-    wp_enqueue_script('geodirectory-choose-ajax');
128
-
129
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
130
-
131
-    if (is_page() && geodir_is_page('add-listing')) {
132
-        // SCRIPT FOR UPLOAD
133
-        wp_enqueue_script('plupload-all');
134
-        wp_enqueue_script('jquery-ui-sortable');
135
-
136
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
137
-        wp_enqueue_script('geodirectory-plupload-script');
138
-        // SCRIPT FOR UPLOAD END
139
-
140
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
141
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
142
-            $ajax_url = admin_url('admin-ajax.php');
143
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
-            $ajax_url = admin_url('admin-ajax.php');
145
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
146
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
147
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
148
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
149
-        } else {
150
-            $ajax_url = admin_url('admin-ajax.php');
151
-        }
119
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
120
+	wp_enqueue_script('geodirectory-goMap-script');
121
+
122
+
123
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
124
+	wp_enqueue_script('chosen');
125
+
126
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
127
+	wp_enqueue_script('geodirectory-choose-ajax');
128
+
129
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
130
+
131
+	if (is_page() && geodir_is_page('add-listing')) {
132
+		// SCRIPT FOR UPLOAD
133
+		wp_enqueue_script('plupload-all');
134
+		wp_enqueue_script('jquery-ui-sortable');
135
+
136
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
137
+		wp_enqueue_script('geodirectory-plupload-script');
138
+		// SCRIPT FOR UPLOAD END
139
+
140
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
141
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
142
+			$ajax_url = admin_url('admin-ajax.php');
143
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
+			$ajax_url = admin_url('admin-ajax.php');
145
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
146
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
147
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
148
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
149
+		} else {
150
+			$ajax_url = admin_url('admin-ajax.php');
151
+		}
152 152
 
153
-        // place js config array for plupload
154
-        $plupload_init = array(
155
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
156
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
157
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
158
-            'drop_element' => 'dropbox', // will be adjusted per uploader
159
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
160
-            'multiple_queues' => true,
161
-            'max_file_size' => geodir_max_upload_size(),
162
-            'url' => $ajax_url,
163
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
164
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
165
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
166
-            'multipart' => true,
167
-            'urlstream_upload' => true,
168
-            'multi_selection' => false, // will be added per uploader
169
-            // additional post data to send to our ajax hook
170
-            'multipart_params' => array(
171
-                '_ajax_nonce' => "", // will be added per uploader
172
-                'action' => 'plupload_action', // the ajax action name
173
-                'imgid' => 0 // will be added per uploader
174
-            )
175
-        );
176
-        $base_plupload_config = json_encode($plupload_init);
177
-
178
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
179
-            'upload_img_size' => geodir_max_upload_size());
180
-
181
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
182
-
183
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
184
-    } // End if for add place page
185
-
186
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
187
-    if ($is_detail_page) {
153
+		// place js config array for plupload
154
+		$plupload_init = array(
155
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
156
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
157
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
158
+			'drop_element' => 'dropbox', // will be adjusted per uploader
159
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
160
+			'multiple_queues' => true,
161
+			'max_file_size' => geodir_max_upload_size(),
162
+			'url' => $ajax_url,
163
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
164
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
165
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
166
+			'multipart' => true,
167
+			'urlstream_upload' => true,
168
+			'multi_selection' => false, // will be added per uploader
169
+			// additional post data to send to our ajax hook
170
+			'multipart_params' => array(
171
+				'_ajax_nonce' => "", // will be added per uploader
172
+				'action' => 'plupload_action', // the ajax action name
173
+				'imgid' => 0 // will be added per uploader
174
+			)
175
+		);
176
+		$base_plupload_config = json_encode($plupload_init);
177
+
178
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
179
+			'upload_img_size' => geodir_max_upload_size());
180
+
181
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
182
+
183
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
184
+	} // End if for add place page
185
+
186
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
187
+	if ($is_detail_page) {
188 188
 		wp_enqueue_script('geodirectory-post-custom-js');
189 189
 	}
190 190
 
191
-    // font awesome rating script
191
+	// font awesome rating script
192 192
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
193 193
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
194 194
 		wp_enqueue_script('geodir-barrating-js');
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
 		wp_enqueue_script('geodir-jRating-js');
198 198
 	}
199 199
 
200
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
201
-    wp_enqueue_script('geodir-on-document-load');
200
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
201
+	wp_enqueue_script('geodir-on-document-load');
202 202
 
203
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
204
-    wp_enqueue_script('google-geometa');
203
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
204
+	wp_enqueue_script('google-geometa');
205 205
 }
206 206
 
207 207
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_header_scripts()
217 217
 {
218
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
219
-    echo stripslashes(get_option('geodir_header_scripts'));
218
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
219
+	echo stripslashes(get_option('geodir_header_scripts'));
220 220
 }
221 221
 
222 222
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 function geodir_footer_scripts()
233 233
 {	
234 234
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
235
-    echo stripslashes(get_option('geodir_footer_scripts'));
235
+	echo stripslashes(get_option('geodir_footer_scripts'));
236 236
 }
237 237
 
238 238
 
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
  */
247 247
 function geodir_add_async_forscript($url)
248 248
 {
249
-    if (strpos($url, '#asyncload')===false)
250
-        return $url;
251
-    else if (is_admin())
252
-        return str_replace('#asyncload', '', $url);
253
-    else
254
-        return str_replace('#asyncload', '', $url)."' async='async";
249
+	if (strpos($url, '#asyncload')===false)
250
+		return $url;
251
+	else if (is_admin())
252
+		return str_replace('#asyncload', '', $url);
253
+	else
254
+		return str_replace('#asyncload', '', $url)."' async='async";
255 255
 }
256 256
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
257 257
 
@@ -264,17 +264,17 @@  discard block
 block discarded – undo
264 264
 function geodir_templates_styles()
265 265
 {
266 266
 
267
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
268
-    wp_enqueue_style('geodir-core-scss');
269
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
267
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
268
+	wp_enqueue_style('geodir-core-scss');
269
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
270 270
 
271
-    if(is_rtl()){
272
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
273
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
274
-    }
271
+	if(is_rtl()){
272
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
273
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
274
+	}
275 275
 
276
-    wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
277
-    wp_enqueue_style('font-awesome');
276
+	wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
277
+	wp_enqueue_style('font-awesome');
278 278
 
279 279
 
280 280
 }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
  */
289 289
 function geodir_get_sidebar()
290 290
 {
291
-    get_sidebar('geodirectory');
291
+	get_sidebar('geodirectory');
292 292
 }
293 293
 
294 294
 /**
@@ -307,122 +307,122 @@  discard block
 block discarded – undo
307 307
  * @param bool $always_show Do you want to show the pagination always? Default: false.
308 308
  */
309 309
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
310
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
310
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
311 311
 
312
-    if (empty($prelabel)) {
313
-        $prelabel = '<strong>&laquo;</strong>';
314
-    }
312
+	if (empty($prelabel)) {
313
+		$prelabel = '<strong>&laquo;</strong>';
314
+	}
315 315
 
316
-    if (empty($nxtlabel)) {
317
-        $nxtlabel = '<strong>&raquo;</strong>';
318
-    }
316
+	if (empty($nxtlabel)) {
317
+		$nxtlabel = '<strong>&raquo;</strong>';
318
+	}
319 319
 
320
-    $half_pages_to_show = round($pages_to_show / 2);
320
+	$half_pages_to_show = round($pages_to_show / 2);
321 321
 
322
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
323
-        return;
322
+	if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
323
+		return;
324 324
 
325
-    if (!is_single()) {
326
-        if (function_exists('geodir_location_geo_home_link')) {
327
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
328
-        }
329
-        $numposts = $wp_query->found_posts;
325
+	if (!is_single()) {
326
+		if (function_exists('geodir_location_geo_home_link')) {
327
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
328
+		}
329
+		$numposts = $wp_query->found_posts;
330 330
 
331
-        $max_page = ceil($numposts / $posts_per_page);
331
+		$max_page = ceil($numposts / $posts_per_page);
332 332
 
333
-        if (empty($paged)) {
334
-            $paged = 1;
335
-        }
333
+		if (empty($paged)) {
334
+			$paged = 1;
335
+		}
336 336
         
337
-        $post_type = geodir_get_current_posttype();
338
-        $listing_type_name = get_post_type_plural_label($post_type);
339
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
340
-            $term = array();
337
+		$post_type = geodir_get_current_posttype();
338
+		$listing_type_name = get_post_type_plural_label($post_type);
339
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
340
+			$term = array();
341 341
             
342
-            if (is_tax()) {
343
-                $term_id = get_queried_object_id();
344
-                $taxonomy = get_query_var('taxonomy');
342
+			if (is_tax()) {
343
+				$term_id = get_queried_object_id();
344
+				$taxonomy = get_query_var('taxonomy');
345 345
 
346
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
347
-                    $term = get_term($term_id, $post_type . 'category');
348
-                }
349
-            }
346
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
347
+					$term = get_term($term_id, $post_type . 'category');
348
+				}
349
+			}
350 350
             
351
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
352
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
351
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
352
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
353 353
                 
354
-                if (!is_array($taxonomy_search)) {
355
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
356
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
357
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
358
-                }
359
-            }
354
+				if (!is_array($taxonomy_search)) {
355
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
356
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
357
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
358
+				}
359
+			}
360 360
             
361
-            if (!empty($term) && !is_wp_error($term)) {
362
-                $listing_type_name = $term->name;
363
-            }
364
-        }
361
+			if (!empty($term) && !is_wp_error($term)) {
362
+				$listing_type_name = $term->name;
363
+			}
364
+		}
365 365
 
366
-        if ($max_page > 1 || $always_show) {            
367
-            // Extra pagination info
368
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
369
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
370
-            $end_no = min($paged * $posts_per_page, $numposts);
366
+		if ($max_page > 1 || $always_show) {            
367
+			// Extra pagination info
368
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
369
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
370
+			$end_no = min($paged * $posts_per_page, $numposts);
371 371
 
372
-            if ($geodir_pagination_more_info != '') {
373
-                if ($listing_type_name) {
374
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
375
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
376
-                } else {
377
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
378
-                }
379
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
380
-                /**
381
-                 * Adds an extra pagination info above/under pagination.
382
-                 *
383
-                 * @since 1.5.9
384
-                 *
385
-                 * @param string $pagination_info Extra pagination info content.
386
-                 * @param string $listing_type_name Listing results type.
387
-                 * @param string $start_no First result number.
388
-                 * @param string $end_no Last result number.
389
-                 * @param string $numposts Total number of listings.
390
-                 * @param string $post_type The post type.
391
-                 */
392
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
372
+			if ($geodir_pagination_more_info != '') {
373
+				if ($listing_type_name) {
374
+					$listing_type_name = __($listing_type_name, 'geodirectory');
375
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
376
+				} else {
377
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
378
+				}
379
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
380
+				/**
381
+				 * Adds an extra pagination info above/under pagination.
382
+				 *
383
+				 * @since 1.5.9
384
+				 *
385
+				 * @param string $pagination_info Extra pagination info content.
386
+				 * @param string $listing_type_name Listing results type.
387
+				 * @param string $start_no First result number.
388
+				 * @param string $end_no Last result number.
389
+				 * @param string $numposts Total number of listings.
390
+				 * @param string $post_type The post type.
391
+				 */
392
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
393 393
                 
394
-                if ($geodir_pagination_more_info == 'before') {
395
-                    $before = $before . $pagination_info;
396
-                } else if ($geodir_pagination_more_info == 'after') {
397
-                    $after = $pagination_info . $after;
398
-                }
399
-            }
394
+				if ($geodir_pagination_more_info == 'before') {
395
+					$before = $before . $pagination_info;
396
+				} else if ($geodir_pagination_more_info == 'after') {
397
+					$after = $pagination_info . $after;
398
+				}
399
+			}
400 400
             
401
-            echo "$before <div class='Navi gd-navi'>";
402
-            if ($paged >= ($pages_to_show - 1)) {
403
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
404
-            }
405
-            previous_posts_link($prelabel);
406
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
407
-                if ($i >= 1 && $i <= $max_page) {
408
-                    if ($i == $paged) {
409
-                        echo "<strong class='on'>$i</strong>";
410
-                    } else {
411
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
412
-                    }
413
-                }
414
-            }
415
-            next_posts_link($nxtlabel, $max_page);
416
-            if (($paged + $half_pages_to_show) < ($max_page)) {
417
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
418
-            }
419
-            echo "</div> $after";
420
-        }
401
+			echo "$before <div class='Navi gd-navi'>";
402
+			if ($paged >= ($pages_to_show - 1)) {
403
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
404
+			}
405
+			previous_posts_link($prelabel);
406
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
407
+				if ($i >= 1 && $i <= $max_page) {
408
+					if ($i == $paged) {
409
+						echo "<strong class='on'>$i</strong>";
410
+					} else {
411
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
412
+					}
413
+				}
414
+			}
415
+			next_posts_link($nxtlabel, $max_page);
416
+			if (($paged + $half_pages_to_show) < ($max_page)) {
417
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
418
+			}
419
+			echo "</div> $after";
420
+		}
421 421
         
422
-        if (function_exists('geodir_location_geo_home_link')) {
423
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
424
-        }
425
-    }
422
+		if (function_exists('geodir_location_geo_home_link')) {
423
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
424
+		}
425
+	}
426 426
 }
427 427
 
428 428
 /**
@@ -433,20 +433,20 @@  discard block
 block discarded – undo
433 433
  */
434 434
 function geodir_listingsearch_scripts()
435 435
 {
436
-    if (get_option('gd_search_dist') != '') {
437
-        $dist = get_option('gd_search_dist');
438
-    } else {
439
-        $dist = 500;
440
-    }
441
-    $dist_dif = 1000;
442
-
443
-    if ($dist <= 5000) $dist_dif = 500;
444
-    if ($dist <= 1000) $dist_dif = 100;
445
-    if ($dist <= 500) $dist_dif = 50;
446
-    if ($dist <= 100) $dist_dif = 10;
447
-    if ($dist <= 50) $dist_dif = 5;
448
-
449
-    ?>
436
+	if (get_option('gd_search_dist') != '') {
437
+		$dist = get_option('gd_search_dist');
438
+	} else {
439
+		$dist = 500;
440
+	}
441
+	$dist_dif = 1000;
442
+
443
+	if ($dist <= 5000) $dist_dif = 500;
444
+	if ($dist <= 1000) $dist_dif = 100;
445
+	if ($dist <= 500) $dist_dif = 50;
446
+	if ($dist <= 100) $dist_dif = 10;
447
+	if ($dist <= 50) $dist_dif = 5;
448
+
449
+	?>
450 450
     <script type="text/javascript">
451 451
 
452 452
         jQuery(function ($) {
@@ -505,15 +505,15 @@  discard block
 block discarded – undo
505 505
 function geodir_add_sharelocation_scripts()
506 506
 {
507 507
 
508
-    $default_search_for_text = SEARCH_FOR_TEXT;
509
-    if (get_option('geodir_search_field_default_text'))
510
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
508
+	$default_search_for_text = SEARCH_FOR_TEXT;
509
+	if (get_option('geodir_search_field_default_text'))
510
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
511 511
 
512
-    $default_near_text = NEAR_TEXT;
513
-    if (get_option('geodir_near_field_default_text'))
514
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
512
+	$default_near_text = NEAR_TEXT;
513
+	if (get_option('geodir_near_field_default_text'))
514
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
515 515
 
516
-    ?>
516
+	?>
517 517
 
518 518
 
519 519
     <script type="text/javascript">
@@ -594,14 +594,14 @@  discard block
 block discarded – undo
594 594
                     initialise2();
595 595
                 } else {
596 596
                     <?php
597
-                    $near_add = get_option('geodir_search_near_addition');
598
-                    /**
599
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
600
-                     *
601
-                     * @since 1.0.0
602
-                     */
603
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
604
-                    ?>
597
+					$near_add = get_option('geodir_search_near_addition');
598
+					/**
599
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
600
+					 *
601
+					 * @since 1.0.0
602
+					 */
603
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
604
+					?>
605 605
                     if (window.gdMaps === 'google') {
606 606
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
607 607
                             function (results, status) {
@@ -704,30 +704,30 @@  discard block
 block discarded – undo
704 704
  */
705 705
 function geodir_show_badges_on_image($which, $post, $link)
706 706
 {
707
-    $return = '';
708
-    switch ($which) {
709
-        case 'featured':
710
-            /**
711
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
712
-             *
713
-             * @since 1.0.0
714
-             * @param object $post The post object.
715
-             * @param string $link The link to the post.
716
-             */
717
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
718
-            break;
719
-        case 'new' :
720
-            /**
721
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
722
-             *
723
-             * @since 1.0.0
724
-             * @param object $post The post object.
725
-             * @param string $link The link to the post.
726
-             */
727
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
728
-            break;
729
-
730
-    }
707
+	$return = '';
708
+	switch ($which) {
709
+		case 'featured':
710
+			/**
711
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
712
+			 *
713
+			 * @since 1.0.0
714
+			 * @param object $post The post object.
715
+			 * @param string $link The link to the post.
716
+			 */
717
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
718
+			break;
719
+		case 'new' :
720
+			/**
721
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
722
+			 *
723
+			 * @since 1.0.0
724
+			 * @param object $post The post object.
725
+			 * @param string $link The link to the post.
726
+			 */
727
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
728
+			break;
729
+
730
+	}
731 731
     
732
-    return $return;
732
+	return $return;
733 733
 }
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93
+        $map_key = "&key=".geodir_get_map_api_key();
94 94
         /**
95 95
          * Filter the variables that are added to the end of the google maps script call.
96 96
          *
@@ -100,40 +100,40 @@  discard block
 block discarded – undo
100 100
          * @param string $var The string to filter, default is empty string.
101 101
          */
102 102
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
103
+        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
104 104
     }
105 105
     
106 106
     if ($geodir_map_name == 'osm') {
107 107
         // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109 109
         wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112 112
         wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115 115
         wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
     }
117
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
117
+    wp_enqueue_script('jquery-ui-autocomplete');
118 118
     
119
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
119
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
120 120
     wp_enqueue_script('geodirectory-goMap-script');
121 121
 
122 122
 
123
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
123
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
124 124
     wp_enqueue_script('chosen');
125 125
 
126
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
126
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
127 127
     wp_enqueue_script('geodirectory-choose-ajax');
128 128
 
129
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
129
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
130 130
 
131 131
     if (is_page() && geodir_is_page('add-listing')) {
132 132
         // SCRIPT FOR UPLOAD
133 133
         wp_enqueue_script('plupload-all');
134 134
         wp_enqueue_script('jquery-ui-sortable');
135 135
 
136
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
136
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
137 137
         wp_enqueue_script('geodirectory-plupload-script');
138 138
         // SCRIPT FOR UPLOAD END
139 139
 
@@ -180,27 +180,27 @@  discard block
 block discarded – undo
180 180
 
181 181
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
182 182
 
183
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
183
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
184 184
     } // End if for add place page
185 185
 
186
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
186
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
187 187
     if ($is_detail_page) {
188 188
 		wp_enqueue_script('geodirectory-post-custom-js');
189 189
 	}
190 190
 
191 191
     // font awesome rating script
192 192
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
193
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
193
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
194 194
 		wp_enqueue_script('geodir-barrating-js');
195 195
 	} else { // default rating script
196
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
196
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
197 197
 		wp_enqueue_script('geodir-jRating-js');
198 198
 	}
199 199
 
200
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
200
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
201 201
     wp_enqueue_script('geodir-on-document-load');
202 202
 
203
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
203
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
204 204
     wp_enqueue_script('google-geometa');
205 205
 }
206 206
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_header_scripts()
217 217
 {
218
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
218
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
219 219
     echo stripslashes(get_option('geodir_header_scripts'));
220 220
 }
221 221
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  */
247 247
 function geodir_add_async_forscript($url)
248 248
 {
249
-    if (strpos($url, '#asyncload')===false)
249
+    if (strpos($url, '#asyncload') === false)
250 250
         return $url;
251 251
     else if (is_admin())
252 252
         return str_replace('#asyncload', '', $url);
@@ -264,12 +264,12 @@  discard block
 block discarded – undo
264 264
 function geodir_templates_styles()
265 265
 {
266 266
 
267
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
267
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
268 268
     wp_enqueue_style('geodir-core-scss');
269
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
269
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
270 270
 
271
-    if(is_rtl()){
272
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
271
+    if (is_rtl()) {
272
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
273 273
     wp_enqueue_style('geodirectory-frontend-rtl-style');
274 274
     }
275 275
 
@@ -343,18 +343,18 @@  discard block
 block discarded – undo
343 343
                 $term_id = get_queried_object_id();
344 344
                 $taxonomy = get_query_var('taxonomy');
345 345
 
346
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
347
-                    $term = get_term($term_id, $post_type . 'category');
346
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
347
+                    $term = get_term($term_id, $post_type.'category');
348 348
                 }
349 349
             }
350 350
             
351
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
352
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
351
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
352
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
353 353
                 
354 354
                 if (!is_array($taxonomy_search)) {
355
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
356
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
357
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
355
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
356
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
357
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
358 358
                 }
359 359
             }
360 360
             
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         if ($max_page > 1 || $always_show) {            
367 367
             // Extra pagination info
368 368
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
369
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
369
+            $start_no = ($paged - 1) * $posts_per_page + 1;
370 370
             $end_no = min($paged * $posts_per_page, $numposts);
371 371
 
372 372
             if ($geodir_pagination_more_info != '') {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                 } else {
377 377
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
378 378
                 }
379
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
379
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
380 380
                 /**
381 381
                  * Adds an extra pagination info above/under pagination.
382 382
                  *
@@ -392,15 +392,15 @@  discard block
 block discarded – undo
392 392
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
393 393
                 
394 394
                 if ($geodir_pagination_more_info == 'before') {
395
-                    $before = $before . $pagination_info;
395
+                    $before = $before.$pagination_info;
396 396
                 } else if ($geodir_pagination_more_info == 'after') {
397
-                    $after = $pagination_info . $after;
397
+                    $after = $pagination_info.$after;
398 398
                 }
399 399
             }
400 400
             
401 401
             echo "$before <div class='Navi gd-navi'>";
402 402
             if ($paged >= ($pages_to_show - 1)) {
403
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
403
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
404 404
             }
405 405
             previous_posts_link($prelabel);
406 406
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
                     if ($i == $paged) {
409 409
                         echo "<strong class='on'>$i</strong>";
410 410
                     } else {
411
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
411
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
412 412
                     }
413 413
                 }
414 414
             }
415 415
             next_posts_link($nxtlabel, $max_page);
416 416
             if (($paged + $half_pages_to_show) < ($max_page)) {
417
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
417
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
418 418
             }
419 419
             echo "</div> $after";
420 420
         }
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
         jQuery(function ($) {
453 453
             $("#distance_slider").slider({
454 454
                 range: true,
455
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
455
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
456 456
                 min: 0,
457 457
                 max: <?php echo $dist; ?>,
458 458
                 step: <?php echo $dist_dif; ?>,
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 
518 518
 
519 519
     <script type="text/javascript">
520
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
520
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
521 521
         var latlng;
522 522
         var address;
523 523
         var dist = 0;
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 				var $form = jQuery(this).closest('form');
531 531
 				
532 532
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
533
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
533
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
534 534
 				
535 535
 				// Disable location based search for disabled location post type.
536 536
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 					}
545 545
 				}
546 546
 				
547
-				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;?>')) {
547
+				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; ?>')) {
548 548
 					geodir_setsearch($form);
549 549
 				} else {
550 550
 					jQuery(".snear", $form).val('');
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
         });
564 564
         
565 565
 		function geodir_setsearch($form) {
566
-			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);
566
+			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);
567 567
 			geocodeAddress($form);
568 568
 		}
569 569
 
@@ -582,15 +582,15 @@  discard block
 block discarded – undo
582 582
             // Call the geocode function
583 583
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
584 584
 
585
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
586
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
585
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
586
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
587 587
                     jQuery(".snear", $form).val('');
588 588
                 }
589 589
                 jQuery($form).submit();
590 590
             } else {
591 591
                 var address = jQuery(".snear", $form).val();
592 592
 
593
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
593
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
594 594
                     initialise2();
595 595
                 } else {
596 596
                     <?php
@@ -603,12 +603,12 @@  discard block
 block discarded – undo
603 603
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
604 604
                     ?>
605 605
                     if (window.gdMaps === 'google') {
606
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
606
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
607 607
                             function (results, status) {
608 608
                                 if (status == google.maps.GeocoderStatus.OK) {
609 609
                                     updateSearchPosition(results[0].geometry.location, $form);
610 610
                                 } else {
611
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status);
611
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
612 612
                                 }
613 613
                             });
614 614
                     } else if (window.gdMaps === 'osm') {
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
618 618
                                     updateSearchPosition(geo, $form);
619 619
                                 } else {
620
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
620
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
621 621
                                 }
622 622
                             });
623 623
                     } else {
@@ -663,19 +663,19 @@  discard block
 block discarded – undo
663 663
             var msg;
664 664
             switch (err.code) {
665 665
                 case err.UNKNOWN_ERROR:
666
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
666
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
667 667
                     break;
668 668
                 case err.PERMISSION_DENINED:
669
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
669
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
670 670
                     break;
671 671
                 case err.POSITION_UNAVAILABLE:
672
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
672
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
673 673
                     break;
674 674
                 case err.BREAK:
675
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
675
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
676 676
                     break;
677 677
                 default:
678
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
678
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
679 679
             }
680 680
             jQuery('#info').html(msg);
681 681
         }
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
              * @param object $post The post object.
715 715
              * @param string $link The link to the post.
716 716
              */
717
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
717
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
718 718
             break;
719 719
         case 'new' :
720 720
             /**
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
              * @param object $post The post object.
725 725
              * @param string $link The link to the post.
726 726
              */
727
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
727
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
728 728
             break;
729 729
 
730 730
     }
Please login to merge, or discard this patch.
language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 define('LISTING_DETAILS_TEXT', __('Enter Listing Details', 'geodirectory'));
42 42
 
43 43
 define('PLACE_TITLE_TEXT', __('Listing Title', 'geodirectory')); // depreciated @since 1.6.3
44
-define('PLACE_DESC_TEXT', __('Listing Description', 'geodirectory'));// depreciated @since 1.6.3
44
+define('PLACE_DESC_TEXT', __('Listing Description', 'geodirectory')); // depreciated @since 1.6.3
45 45
 
46 46
 define('LISTING_ADDRESS_TEXT', __('Listing Address:', 'geodirectory'));
47 47
 define('PLACE_ADDRESS', __('Address:', 'geodirectory'));
Please login to merge, or discard this patch.
geodirectory-functions/custom_field_html.php 3 patches
Indentation   +227 added lines, -227 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 global $post_type;
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21
-    $post_type = sanitize_text_field($_REQUEST['listing_type']);
21
+	$post_type = sanitize_text_field($_REQUEST['listing_type']);
22 22
 } else
23
-    $post_type = $field_info->post_type;
23
+	$post_type = $field_info->post_type;
24 24
 
25 25
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
26 26
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 $field_admin_title = '';
30 30
 if (isset($field_info->admin_title))
31
-    $field_admin_title = $field_info->admin_title;
31
+	$field_admin_title = $field_info->admin_title;
32 32
 
33 33
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
34 34
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
48 48
         <?php
49 49
 
50
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
51
-        ?>
50
+		$nonce = wp_create_nonce('custom_fields_' . $result_str);
51
+		?>
52 52
 
53 53
         <?php if ($default): ?>
54 54
             <div title="<?php _e('Drag and drop to sort', 'geodirectory'); ?>" class="handlediv move"></div>
@@ -57,42 +57,42 @@  discard block
 block discarded – undo
57 57
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
58 58
                  class="handlediv close"></div>
59 59
         <?php endif;
60
-        if ($field_type == 'fieldset') {
61
-            ?>
60
+		if ($field_type == 'fieldset') {
61
+			?>
62 62
 
63 63
             <b style="cursor:pointer;"
64 64
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
65 65
         <?php
66
-        } else {
67
-            ?>
66
+		} else {
67
+			?>
68 68
             <b style="cursor:pointer;"
69 69
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' ' . $field_admin_title . ' (' . $field_type . ')');?></b>
70 70
         <?php
71
-        }
72
-        ?>
71
+		}
72
+		?>
73 73
     </div>
74 74
 
75 75
     <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
76 76
          style="display:<?php if ($field_ins_upd == 'submit') {
77
-             echo 'block;';
78
-         } else {
79
-             echo 'none;';
80
-         } ?>">
77
+			 echo 'block;';
78
+		 } else {
79
+			 echo 'none;';
80
+		 } ?>">
81 81
         <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/>
82 82
         <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
83 83
         <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
84 84
         <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/>
85 85
         <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
86
-            echo $field_info->data_type;
87
-        } ?>"/>
86
+			echo $field_info->data_type;
87
+		} ?>"/>
88 88
         <input type="hidden" name="is_active" id="is_active" value="1"/>
89 89
 
90 90
         <table class="widefat post fixed" border="0" style="width:100%;">
91 91
             <?php if ($field_type != 'text' || $default) { ?>
92 92
 
93 93
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
94
-                    echo esc_attr($field_info->data_type);
95
-                } ?>"/>
94
+					echo esc_attr($field_info->data_type);
95
+				} ?>"/>
96 96
 
97 97
             <?php } else { ?>
98 98
 
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
                                 onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');">
105 105
                             <option
106 106
                                 value="XVARCHAR" <?php if (isset($field_info->data_type) && $field_info->data_type == 'VARCHAR') {
107
-                                echo 'selected="selected"';
108
-                            } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
107
+								echo 'selected="selected"';
108
+							} ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
109 109
                             <option
110 110
                                 value="INT" <?php if (isset($field_info->data_type) && $field_info->data_type == 'INT') {
111
-                                echo 'selected="selected"';
112
-                            } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
111
+								echo 'selected="selected"';
112
+							} ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
113 113
                             <option
114 114
                                 value="FLOAT" <?php if (isset($field_info->data_type) && $field_info->data_type == 'FLOAT') {
115
-                                echo 'selected="selected"';
116
-                            } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
115
+								echo 'selected="selected"';
116
+							} ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
117 117
                         </select>
118 118
                         <br/> <span><?php _e('Select Custom Field type', 'geodirectory'); ?></span>
119 119
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
                         <select name="decimal_point" id="decimal_point">
128 128
                             <option value=""><?php echo _e('Select', 'geodirectory'); ?></option>
129 129
                             <?php for ($i = 1; $i <= 10; $i++) {
130
-                                $decimal_point = isset($field_info->decimal_point) ? $field_info->decimal_point : '';
131
-                                $selected = $i == $decimal_point ? 'selected="selected"' : ''; ?>
130
+								$decimal_point = isset($field_info->decimal_point) ? $field_info->decimal_point : '';
131
+								$selected = $i == $decimal_point ? 'selected="selected"' : ''; ?>
132 132
                                 <option value="<?php echo $i; ?>" <?php echo $selected; ?>><?php echo $i; ?></option>
133 133
                             <?php } ?>
134 134
                         </select>
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
                 <td align="left">
144 144
                     <input type="text" name="admin_title" id="admin_title"
145 145
                            value="<?php if (isset($field_info->admin_title)) {
146
-                               echo esc_attr($field_info->admin_title);
147
-                           } ?>"/>
146
+							   echo esc_attr($field_info->admin_title);
147
+						   } ?>"/>
148 148
                     <br/><span><?php _e('Personal comment, it would not be displayed anywhere except in custom field settings', 'geodirectory'); ?></span>
149 149
                 </td>
150 150
             </tr>
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
                 <td align="left">
154 154
                     <input type="text" name="site_title" id="site_title"
155 155
                            value="<?php if (isset($field_info->site_title)) {
156
-                               echo esc_attr($field_info->site_title);
157
-                           } ?>"/>
156
+							   echo esc_attr($field_info->site_title);
157
+						   } ?>"/>
158 158
                     <br/><span><?php _e('Section title which you wish to display in frontend', 'geodirectory'); ?></span>
159 159
                 </td>
160 160
             </tr>
@@ -163,23 +163,23 @@  discard block
 block discarded – undo
163 163
                 <td align="left">
164 164
                     <input type="text" name="admin_desc" id="admin_desc"
165 165
                            value="<?php if (isset($field_info->admin_desc)) {
166
-                               echo esc_attr($field_info->admin_desc);
167
-                           } ?>"/>
166
+							   echo esc_attr($field_info->admin_desc);
167
+						   } ?>"/>
168 168
                     <br/><span><?php _e('Section description which will appear in frontend', 'geodirectory'); ?></span>
169 169
                 </td>
170 170
             </tr>
171 171
             <?php if ($field_type != 'fieldset' && $field_type != 'taxonomy') {
172
-                ?>
172
+				?>
173 173
 
174 174
                 <tr>
175 175
                     <td><strong><?php _e('HTML variable name :', 'geodirectory');?></strong></td>
176 176
                     <td align="left">
177 177
                         <input type="text" name="htmlvar_name" id="htmlvar_name"
178 178
                                value="<?php if (isset($field_info->htmlvar_name)) {
179
-                                   echo preg_replace('/geodir_/', '', $field_info->htmlvar_name, 1);
180
-                               }?>" <?php if ($default) {
181
-                            echo 'readonly="readonly"';
182
-                        }?> />
179
+								   echo preg_replace('/geodir_/', '', $field_info->htmlvar_name, 1);
180
+							   }?>" <?php if ($default) {
181
+							echo 'readonly="readonly"';
182
+						}?> />
183 183
                         <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory');?></span>
184 184
                         <br/> <span><?php _e('This should be a unique name', 'geodirectory');?></span>
185 185
                         <br/>
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
                 <td><strong><?php _e('Admin label :', 'geodirectory'); ?></strong></td>
192 192
                 <td align="left"><input type="text" name="clabels" id="clabels"
193 193
                                         value="<?php if (isset($field_info->clabels)) {
194
-                                            echo esc_attr($field_info->clabels);
195
-                                        } ?>"/>
194
+											echo esc_attr($field_info->clabels);
195
+										} ?>"/>
196 196
                     <br/>
197 197
                     <span><?php _e('Section Title which will appear in backend', 'geodirectory'); ?></span>
198 198
                 </td>
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
                 <td><strong><?php _e('Display order :', 'geodirectory'); ?></strong></td>
224 224
                 <td align="left"><input type="text" readonly="readonly" name="sort_order" id="sort_order"
225 225
                                         value="<?php if (isset($field_info->sort_order)) {
226
-                                            echo esc_attr($field_info->sort_order);
227
-                                        } ?>"/>
226
+											echo esc_attr($field_info->sort_order);
227
+										} ?>"/>
228 228
                     <br/>
229 229
                     <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory'); ?></span>
230 230
                 </td>
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
                 <td align="left">
236 236
                     <select name="is_default" id="is_default">
237 237
                         <option value="0" <?php if (!isset($field_info->is_default) || $field_info->is_default == '0') {
238
-                            echo 'selected="selected"';
239
-                        } ?>><?php _e('No', 'geodirectory'); ?></option>
238
+							echo 'selected="selected"';
239
+						} ?>><?php _e('No', 'geodirectory'); ?></option>
240 240
                         <option value="1" <?php if (isset($field_info->is_default) && $field_info->is_default == '1') {
241
-                            echo 'selected="selected"';
242
-                        } ?>><?php _e('Yes', 'geodirectory'); ?></option>
241
+							echo 'selected="selected"';
242
+						} ?>><?php _e('Yes', 'geodirectory'); ?></option>
243 243
                     </select>
244 244
                     <br/>
245 245
                     <span><?php _e('Select yes or no. If no is selected then the field will be displayed as main form field or additional field', 'geodirectory'); ?></span>
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
                 <td>
255 255
 
256 256
                     <?php
257
-                    $selected = '';
258
-                    if (isset($field_info->extra_fields))
259
-                        $advanced_editor = unserialize($field_info->extra_fields);
257
+					$selected = '';
258
+					if (isset($field_info->extra_fields))
259
+						$advanced_editor = unserialize($field_info->extra_fields);
260 260
 
261
-                    if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
262
-                        $selected = 'checked="checked"';
263
-                    ?>
261
+					if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
262
+						$selected = 'checked="checked"';
263
+					?>
264 264
 
265 265
                     <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
266 266
                            value="1" <?php echo $selected; ?>/>
@@ -268,42 +268,42 @@  discard block
 block discarded – undo
268 268
                 </td>
269 269
 
270 270
                 </tr><?php
271
-            } ?>
271
+			} ?>
272 272
 
273 273
             <?php
274 274
 
275
-            $pricearr = array();
276
-            if (isset($field_info->packages) && $field_info->packages != '') {
277
-                $pricearr = explode(',', trim($field_info->packages, ','));
278
-            } else {
279
-                $package_info = array();
275
+			$pricearr = array();
276
+			if (isset($field_info->packages) && $field_info->packages != '') {
277
+				$pricearr = explode(',', trim($field_info->packages, ','));
278
+			} else {
279
+				$package_info = array();
280 280
 
281
-                $package_info = geodir_post_package_info($package_info, '', $post_type);
282
-                $pricearr[] = $package_info->pid;
283
-            }
281
+				$package_info = geodir_post_package_info($package_info, '', $post_type);
282
+				$pricearr[] = $package_info->pid;
283
+			}
284 284
 
285
-            ob_start()
286
-            ?>
285
+			ob_start()
286
+			?>
287 287
 
288 288
             <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple">
289 289
                 <?php
290
-                if (!empty($pricearr)) {
291
-                    foreach ($pricearr as $val) {
292
-                        ?>
290
+				if (!empty($pricearr)) {
291
+					foreach ($pricearr as $val) {
292
+						?>
293 293
                         <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php
294
-                    }
295
-                }
296
-                ?>
294
+					}
295
+				}
296
+				?>
297 297
             </select>
298 298
 
299 299
             <?php
300
-            $html = ob_get_clean();
300
+			$html = ob_get_clean();
301 301
 
302 302
 			/**
303 303
 			 * Filter the price packages list.
304 304
 			 *
305 305
 			 * Filter the price packages list in custom field form in admin
306
-             * custom fields settings.
306
+			 * custom fields settings.
307 307
 			 *
308 308
 			 * @since 1.0.0
309 309
 			 *
@@ -312,26 +312,26 @@  discard block
 block discarded – undo
312 312
 			 */
313 313
 			echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
314 314
 
315
-            ?>
315
+			?>
316 316
 
317 317
             <tr>
318 318
                 <td><strong><?php _e('Is active :', 'geodirectory'); ?></strong></td>
319 319
                 <td align="left">
320 320
                     <select name="is_active" id="is_active">
321 321
                         <option value="1" <?php if (isset($field_info->is_active) && $field_info->is_active == '1') {
322
-                            echo 'selected="selected"';
323
-                        } ?>><?php _e('Yes', 'geodirectory'); ?></option>
322
+							echo 'selected="selected"';
323
+						} ?>><?php _e('Yes', 'geodirectory'); ?></option>
324 324
                         <option
325 325
                             value="0" <?php if ((isset($field_info->is_active) && $field_info->is_active == '0') || !isset($field_info->is_active)) {
326
-                            echo 'selected="selected"';
327
-                        } ?>><?php _e('No', 'geodirectory'); ?></option>
326
+							echo 'selected="selected"';
327
+						} ?>><?php _e('No', 'geodirectory'); ?></option>
328 328
                     </select>
329 329
                     <br/>
330 330
                     <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere', 'geodirectory'); ?></span>
331 331
                 </td>
332 332
             </tr>
333 333
             <?php if (!$default) { /* field for admin use only */
334
-                $for_admin_use = isset($field_info->for_admin_use) && $field_info->for_admin_use == '1' ? true : false; ?>
334
+				$for_admin_use = isset($field_info->for_admin_use) && $field_info->for_admin_use == '1' ? true : false; ?>
335 335
                 <tr>
336 336
                     <td><strong><?php _e('For admin use only? :', 'geodirectory'); ?></strong></td>
337 337
                     <td align="left">
@@ -353,12 +353,12 @@  discard block
 block discarded – undo
353 353
                         <select name="is_required" id="is_required">
354 354
                             <option
355 355
                                 value="1" <?php if (isset($field_info->is_required) && $field_info->is_required == '1') {
356
-                                echo 'selected="selected"';
357
-                            } ?>><?php _e('Yes', 'geodirectory'); ?></option>
356
+								echo 'selected="selected"';
357
+							} ?>><?php _e('Yes', 'geodirectory'); ?></option>
358 358
                             <option
359 359
                                 value="0" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {
360
-                                echo 'selected="selected"';
361
-                            } ?>><?php _e('No', 'geodirectory'); ?></option>
360
+								echo 'selected="selected"';
361
+							} ?>><?php _e('No', 'geodirectory'); ?></option>
362 362
                         </select>
363 363
                         <br/> <span><?php _e('Select yes to set field as required', 'geodirectory'); ?></span>
364 364
                     </td>
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
                 <td align="left">
371 371
                     <input type="text" name="required_msg" id="required_msg"
372 372
                            value="<?php if (isset($field_info->required_msg)) {
373
-                               echo esc_attr($field_info->required_msg);
374
-                           } ?>"/>
373
+							   echo esc_attr($field_info->required_msg);
374
+						   } ?>"/>
375 375
                     <span>
376 376
                         <?php _e('Enter text for error message if field required and have not full fill requirement.', 'geodirectory'); ?>
377 377
                     </span>
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
                 <td align="left">
386 386
                     <input type="text" name="validation_pattern" id="validation_pattern"
387 387
                            value="<?php if (isset($field_info->validation_pattern)) {
388
-                               echo esc_attr($field_info->validation_pattern);
389
-                           } ?>"/>
388
+							   echo esc_attr($field_info->validation_pattern);
389
+						   } ?>"/>
390 390
                     <span>
391 391
                         <?php _e('Enter regex expression for HTML5 pattern validation.', 'geodirectory'); ?>
392 392
                     </span>
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
                 <td align="left">
400 400
                     <input type="text" name="validation_msg" id="validation_msg"
401 401
                            value="<?php if (isset($field_info->validation_msg)) {
402
-                               echo esc_attr($field_info->validation_msg);
403
-                           } ?>"/>
402
+							   echo esc_attr($field_info->validation_msg);
403
+						   } ?>"/>
404 404
                     <span>
405 405
                         <?php _e('Enter a extra validation message to show to the user if validation fails.', 'geodirectory'); ?>
406 406
                     </span>
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
                     <select name="show_on_listing" id="show_on_listing">
416 416
                         <option
417 417
                             value="1" <?php if (isset($field_info->show_on_listing) && $field_info->show_on_listing == '1') {
418
-                            echo 'selected="selected"';
419
-                        } ?>><?php _e('Yes', 'geodirectory'); ?></option>
418
+							echo 'selected="selected"';
419
+						} ?>><?php _e('Yes', 'geodirectory'); ?></option>
420 420
                         <option
421 421
                             value="0" <?php if ((isset($field_info->show_on_listing) && ($field_info->show_on_listing == '0' || $field_info->show_on_listing == '')) || !isset($field_info->show_on_listing)) {
422
-                            echo 'selected="selected"';
423
-                        } ?>><?php _e('No', 'geodirectory'); ?></option>
422
+							echo 'selected="selected"';
423
+						} ?>><?php _e('No', 'geodirectory'); ?></option>
424 424
                     </select>
425 425
                     <br/> <span><?php _e('Want to show this on listing page ?', 'geodirectory'); ?></span>
426 426
                 </td>
@@ -432,12 +432,12 @@  discard block
 block discarded – undo
432 432
                     <select name="show_on_detail" id="show_on_detail">
433 433
                         <option
434 434
                             value="1" <?php if (isset($field_info->show_on_detail) && $field_info->show_on_detail == '1') {
435
-                            echo 'selected="selected"';
436
-                        } ?>><?php _e('Yes', 'geodirectory'); ?></option>
435
+							echo 'selected="selected"';
436
+						} ?>><?php _e('Yes', 'geodirectory'); ?></option>
437 437
                         <option
438 438
                             value="0" <?php if ((isset($field_info->show_on_detail) && ($field_info->show_on_detail == '0' || $field_info->show_on_detail == '')) || !isset($field_info->show_on_detail)) {
439
-                            echo 'selected="selected"';
440
-                        } ?>><?php _e('No', 'geodirectory'); ?></option>
439
+							echo 'selected="selected"';
440
+						} ?>><?php _e('No', 'geodirectory'); ?></option>
441 441
                     </select>
442 442
                     <br/>
443 443
                     <span><?php _e('Want to show this in More Info tab on detail page?', 'geodirectory'); ?></span>
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
                         <select name="show_as_tab" id="show_as_tab">
451 451
                             <option
452 452
                                 value="1" <?php if (isset($field_info->show_as_tab) && $field_info->show_as_tab == '1') {
453
-                                echo 'selected="selected"';
454
-                            } ?>><?php _e('Yes', 'geodirectory'); ?></option>
453
+								echo 'selected="selected"';
454
+							} ?>><?php _e('Yes', 'geodirectory'); ?></option>
455 455
                             <option
456 456
                                 value="0" <?php if ((isset($field_info->show_as_tab) && ($field_info->show_as_tab == '0' || $field_info->show_as_tab == '')) || !isset($field_info->show_as_tab)) {
457
-                                echo 'selected="selected"';
458
-                            } ?>><?php _e('No', 'geodirectory'); ?></option>
457
+								echo 'selected="selected"';
458
+							} ?>><?php _e('No', 'geodirectory'); ?></option>
459 459
                         </select>
460 460
                         <br/><span><?php _e('Want to display this as a tab on detail page? If "Yes" then "Show on detail page?" must be Yes.', 'geodirectory'); ?></span>
461 461
                     </td>
@@ -464,23 +464,23 @@  discard block
 block discarded – undo
464 464
 
465 465
             <?php
466 466
 
467
-            switch ($field_type):
468
-                case 'taxonomy': {
469
-                    ?>
467
+			switch ($field_type):
468
+				case 'taxonomy': {
469
+					?>
470 470
                     <tr>
471 471
                         <td><strong><?php _e('Select taxonomy:', 'geodirectory');?></strong></td>
472 472
                         <td align="left">
473 473
                             <select name="htmlvar_name" id="htmlvar_name">
474 474
                                 <?php
475
-                                $gd_taxonomy = geodir_get_taxonomies($post_type);
475
+								$gd_taxonomy = geodir_get_taxonomies($post_type);
476 476
 
477
-                                foreach ($gd_taxonomy as $gd_tax) {
478
-                                    ?>
477
+								foreach ($gd_taxonomy as $gd_tax) {
478
+									?>
479 479
                                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
480
-                                        echo 'selected="selected"';
481
-                                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
482
-                                }
483
-                                ?>
480
+										echo 'selected="selected"';
481
+									}?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
482
+								}
483
+								?>
484 484
                             </select>
485 485
 
486 486
                             <br/>
@@ -494,20 +494,20 @@  discard block
 block discarded – undo
494 494
 
495 495
                             <select name="cat_display_type" id="cat_display_type">
496 496
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
497
-                                    echo 'selected="selected"';
498
-                                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
497
+									echo 'selected="selected"';
498
+								}?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
499 499
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
500
-                                    echo 'selected="selected"';
501
-                                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
500
+									echo 'selected="selected"';
501
+								}?> value="select"><?php _e('Select', 'geodirectory');?></option>
502 502
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
503
-                                    echo 'selected="selected"';
504
-                                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
503
+									echo 'selected="selected"';
504
+								}?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
505 505
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
506
-                                    echo 'selected="selected"';
507
-                                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
506
+									echo 'selected="selected"';
507
+								}?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
508 508
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
509
-                                    echo 'selected="selected"';
510
-                                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
509
+									echo 'selected="selected"';
510
+								}?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
511 511
                             </select>
512 512
 
513 513
                             <br/>
@@ -515,29 +515,29 @@  discard block
 block discarded – undo
515 515
                         </td>
516 516
                     </tr>
517 517
                 <?php } // end of additional field for taxonomy field type
518
-                    break;
519
-                case 'address': {
520
-                    if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
521
-                        $address = unserialize($field_info->extra_fields);
522
-                    }
523
-                    ?>
518
+					break;
519
+				case 'address': {
520
+					if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
521
+						$address = unserialize($field_info->extra_fields);
522
+					}
523
+					?>
524 524
                     <?php
525
-                    /**
526
-                     * Called on the add custom fields settings page before the address field is output.
527
-                     *
528
-                     * @since 1.0.0
529
-                     * @param array $address The address settings array.
530
-                     * @param object $field_info Extra fileds info.
531
-                     */
532
-                    do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
525
+					/**
526
+					 * Called on the add custom fields settings page before the address field is output.
527
+					 *
528
+					 * @since 1.0.0
529
+					 * @param array $address The address settings array.
530
+					 * @param object $field_info Extra fileds info.
531
+					 */
532
+					do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
533 533
 
534 534
                     <tr>
535 535
                         <td><strong><?php _e('Display zip/post code :', 'geodirectory');?></strong></td>
536 536
                         <td align="left">
537 537
                             <input type="checkbox" name="extra[show_zip]" id="show_zip"
538 538
                                    value="1" <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
539
-                                echo 'checked="checked"';
540
-                            }?>/>
539
+								echo 'checked="checked"';
540
+							}?>/>
541 541
                             <span><?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?></span>
542 542
                         </td>
543 543
                     </tr>
@@ -547,8 +547,8 @@  discard block
 block discarded – undo
547 547
                         <td align="left">
548 548
                             <input type="text" name="extra[zip_lable]" id="zip_lable"
549 549
                                    value="<?php if (isset($address['zip_lable'])) {
550
-                                       echo esc_attr($address['zip_lable']);
551
-                                   }?>"/>
550
+									   echo esc_attr($address['zip_lable']);
551
+								   }?>"/>
552 552
                             <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory');?></span>
553 553
                         </td>
554 554
                     </tr>
@@ -558,8 +558,8 @@  discard block
 block discarded – undo
558 558
                         <td align="left">
559 559
                             <input type="checkbox" name="extra[show_map]" id="show_map"
560 560
                                    value="1" <?php if (isset($address['show_map']) && $address['show_map'] == '1') {
561
-                                echo 'checked="checked"';
562
-                            }?>/>
561
+								echo 'checked="checked"';
562
+							}?>/>
563 563
                             <span><?php _e('Select if you want to `set address on map` field in address section.', 'geodirectory');?></span>
564 564
                         </td>
565 565
                     </tr>
@@ -569,8 +569,8 @@  discard block
 block discarded – undo
569 569
                         <td align="left">
570 570
                             <input type="text" name="extra[map_lable]" id="map_lable"
571 571
                                    value="<?php if (isset($address['map_lable'])) {
572
-                                       echo esc_attr($address['map_lable']);
573
-                                   }?>"/>
572
+									   echo esc_attr($address['map_lable']);
573
+								   }?>"/>
574 574
                             <span><?php _e('Enter text for  `set address on map` button in address section.', 'geodirectory');?></span>
575 575
                         </td>
576 576
                     </tr>
@@ -580,8 +580,8 @@  discard block
 block discarded – undo
580 580
                         <td align="left">
581 581
                             <input type="checkbox" name="extra[show_mapzoom]" id="show_mapzoom"
582 582
                                    value="1" <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
583
-                                echo 'checked="checked"';
584
-                            }?>/>
583
+								echo 'checked="checked"';
584
+							}?>/>
585 585
                             <span><?php _e('Select if you want to use the user defined map zoom level.', 'geodirectory');?></span>
586 586
                         </td>
587 587
                     </tr>
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
                         <td align="left">
592 592
                             <input type="checkbox" name="extra[show_mapview]" id="show_mapview"
593 593
                                    value="1" <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
594
-                                echo 'checked="checked"';
595
-                            }?>/>
594
+								echo 'checked="checked"';
595
+							}?>/>
596 596
                             <span><?php _e('Select if you want to `set default map` options in address section.', 'geodirectory');?></span>
597 597
                         </td>
598 598
                     </tr>
@@ -603,8 +603,8 @@  discard block
 block discarded – undo
603 603
                         <td align="left">
604 604
                             <input type="text" name="extra[mapview_lable]" id="mapview_lable"
605 605
                                    value="<?php if (isset($address['mapview_lable'])) {
606
-                                       echo esc_attr($address['mapview_lable']);
607
-                                   }?>"/>
606
+									   echo esc_attr($address['mapview_lable']);
607
+								   }?>"/>
608 608
                             <span><?php _e('Enter mapview field label in address section.', 'geodirectory');?></span>
609 609
                         </td>
610 610
                     </tr>
@@ -615,33 +615,33 @@  discard block
 block discarded – undo
615 615
                         <td align="left">
616 616
                             <input type="checkbox" name="extra[show_latlng]" id="show_latlng"
617 617
                                    value="1" <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
618
-                                echo 'checked="checked"';
619
-                            }?>/>
618
+								echo 'checked="checked"';
619
+							}?>/>
620 620
                             <span><?php _e('Select if you want to show latitude and logatude fields in address section from front-end.', 'geodirectory');?></span>
621 621
                         </td>
622 622
                     </tr>
623 623
                 <?php } // end of extra fields for address field type
624
-                    break;
625
-                case 'select':
626
-                case 'multiselect':
627
-                case 'radio' : {
628
-                    if ($field_type == 'multiselect') {
624
+					break;
625
+				case 'select':
626
+				case 'multiselect':
627
+				case 'radio' : {
628
+					if ($field_type == 'multiselect') {
629 629
 
630
-                        ?>
630
+						?>
631 631
                         <tr>
632 632
                             <td><strong><?php _e('Multiselect display type :', 'geodirectory');?></strong></td>
633 633
                             <td align="left">
634 634
 
635 635
                                 <select name="multi_display_type" id="multi_display_type">
636 636
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
637
-                                        echo 'selected="selected"';
638
-                                    }?> value="select"><?php _e('Select', 'geodirectory');?></option>
637
+										echo 'selected="selected"';
638
+									}?> value="select"><?php _e('Select', 'geodirectory');?></option>
639 639
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
640
-                                        echo 'selected="selected"';
641
-                                    }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
640
+										echo 'selected="selected"';
641
+									}?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
642 642
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
643
-                                        echo 'selected="selected"';
644
-                                    }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
643
+										echo 'selected="selected"';
644
+									}?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
645 645
                                 </select>
646 646
 
647 647
                                 <br/>
@@ -649,15 +649,15 @@  discard block
 block discarded – undo
649 649
                             </td>
650 650
                         </tr>
651 651
                     <?php
652
-                    }
653
-                    ?>
652
+					}
653
+					?>
654 654
                     <tr>
655 655
                         <td><strong><?php _e('Option Values :', 'geodirectory');?></strong></td>
656 656
                         <td align="left">
657 657
                             <input type="text" name="option_values" id="option_values"
658 658
                                    value="<?php if (isset($field_info->option_values)) {
659
-                                       echo esc_attr($field_info->option_values);
660
-                                   }?>"/>
659
+									   echo esc_attr($field_info->option_values);
660
+								   }?>"/>
661 661
                             <br/>
662 662
                             <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
663 663
                             <br/>
@@ -673,52 +673,52 @@  discard block
 block discarded – undo
673 673
                         </td>
674 674
                     </tr>
675 675
                 <?php
676
-                } // end of extra fields for select , multiselect and radio type fields
677
-                    break;
678
-                case 'datepicker': {
679
-                    if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
680
-                        $extra = unserialize($field_info->extra_fields);
681
-                    }
682
-                    ?>
676
+				} // end of extra fields for select , multiselect and radio type fields
677
+					break;
678
+				case 'datepicker': {
679
+					if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
680
+						$extra = unserialize($field_info->extra_fields);
681
+					}
682
+					?>
683 683
                     <tr>
684 684
                         <td><strong><?php _e('Date Format :', 'geodirectory');?></strong></td>
685 685
                         <td align="left" style="overflow:inherit;">
686 686
                             <?php
687
-                            $date_formats = array(
688
-                                'm/d/Y',
689
-                                'd/m/Y',
690
-                                'Y/m/d',
691
-                                'm-d-Y',
692
-                                'd-m-Y',
693
-                                'Y-m-d',
694
-                                'F j, Y',
695
-                            );
696
-                            /**
697
-                             * Filter the custom field date format options.
698
-                             *
699
-                             * @since 1.6.5
700
-                             * @param array $date_formats The PHP date format array.
701
-                             */
702
-                            $date_formats = apply_filters('geodir_date_formats',$date_formats);
703
-                            ?>
687
+							$date_formats = array(
688
+								'm/d/Y',
689
+								'd/m/Y',
690
+								'Y/m/d',
691
+								'm-d-Y',
692
+								'd-m-Y',
693
+								'Y-m-d',
694
+								'F j, Y',
695
+							);
696
+							/**
697
+							 * Filter the custom field date format options.
698
+							 *
699
+							 * @since 1.6.5
700
+							 * @param array $date_formats The PHP date format array.
701
+							 */
702
+							$date_formats = apply_filters('geodir_date_formats',$date_formats);
703
+							?>
704 704
                             <select name="extra[date_format]" id="date_format">
705 705
                                 <?php
706
-                                foreach($date_formats as $format){
707
-                                    $selected = '';
708
-                                    if(esc_attr($extra['date_format'])==$format){
709
-                                        $selected = "selected='selected'";
710
-                                    }
711
-                                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
712
-                                }
713
-                                ?>
706
+								foreach($date_formats as $format){
707
+									$selected = '';
708
+									if(esc_attr($extra['date_format'])==$format){
709
+										$selected = "selected='selected'";
710
+									}
711
+									echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
712
+								}
713
+								?>
714 714
                             </select>
715 715
                             
716 716
                             <span><?php _e('Select the date format.', 'geodirectory');?></span>
717 717
                         </td>
718 718
                     </tr>
719 719
                 <?php
720
-                }
721
-                    break;
720
+				}
721
+					break;
722 722
 				case 'file': {
723 723
 					$allowed_file_types = geodir_allowed_mime_types();
724 724
 					
@@ -746,9 +746,9 @@  discard block
 block discarded – undo
746 746
 					}
747 747
 					break;
748 748
 
749
-            endswitch; ?>
749
+			endswitch; ?>
750 750
             <?php if ($field_type != 'fieldset') {
751
-                ?>
751
+				?>
752 752
                 <tr>
753 753
                     <td colspan="2" align="left"><h3><?php echo __('Custom css', 'geodirectory'); ?></h3></td>
754 754
                 </tr>
@@ -758,8 +758,8 @@  discard block
 block discarded – undo
758 758
                     <td align="left">
759 759
                         <input type="text" name="field_icon" id="field_icon"
760 760
                                value="<?php if (isset($field_info->field_icon)) {
761
-                                   echo $field_info->field_icon;
762
-                               }?>"/>
761
+								   echo $field_info->field_icon;
762
+							   }?>"/>
763 763
                     <span>
764 764
                         <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
765 765
                     </span>
@@ -772,8 +772,8 @@  discard block
 block discarded – undo
772 772
                     <td align="left">
773 773
                         <input type="text" name="css_class" id="css_class"
774 774
                                value="<?php if (isset($field_info->css_class)) {
775
-                                   echo esc_attr($field_info->css_class);
776
-                               }?>"/>
775
+								   echo esc_attr($field_info->css_class);
776
+							   }?>"/>
777 777
                     <span>
778 778
                         <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
779 779
                     </span>
@@ -781,19 +781,19 @@  discard block
 block discarded – undo
781 781
                     </td>
782 782
                 </tr>
783 783
             <?php
784
-            }
785
-            ?>
784
+			}
785
+			?>
786 786
 
787 787
             <?php
788 788
 
789
-            switch ($field_type):
790
-                case 'html':
791
-                case 'file':
792
-                case 'url':
793
-                case 'fieldset':
794
-                    break;
795
-                default:
796
-                    ?>
789
+			switch ($field_type):
790
+				case 'html':
791
+				case 'file':
792
+				case 'url':
793
+				case 'fieldset':
794
+					break;
795
+				default:
796
+					?>
797 797
 
798 798
                     <tr>
799 799
                         <td colspan="2" align="left">
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 								 */
812 812
 								echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
813 813
 
814
-                                ?></h3>
814
+								?></h3>
815 815
                         </td>
816 816
                     </tr>
817 817
 
@@ -821,23 +821,23 @@  discard block
 block discarded – undo
821 821
                         <td>:
822 822
                             <input type="checkbox" name="cat_sort[]" id="cat_sort"
823 823
                                    value="1" <?php if (isset($field_info->cat_sort[0]) && $field_info->cat_sort[0] == '1') {
824
-                                echo 'checked="checked"';
825
-                            } ?>/>
824
+								echo 'checked="checked"';
825
+							} ?>/>
826 826
                             <span><?php _e('Select if you want to show option in sort.', 'geodirectory'); ?></span>
827 827
                         </td>
828 828
                     </tr>
829 829
                 <?php } ?>
830 830
 
831 831
                     <?php
832
-                    /**
833
-                     * Called at the end of the advanced custom fields settings page loop.
834
-                     *
835
-                     * Can be used to add or deal with different settings types.
836
-                     *
837
-                     * @since 1.0.0
838
-                     * @param object $field_info The current fields info.
839
-                     */
840
-                    do_action('geodir_advance_custom_fields', $field_info);?>
832
+					/**
833
+					 * Called at the end of the advanced custom fields settings page loop.
834
+					 *
835
+					 * Can be used to add or deal with different settings types.
836
+					 *
837
+					 * @since 1.0.0
838
+					 * @param object $field_info The current fields info.
839
+					 */
840
+					do_action('geodir_advance_custom_fields', $field_info);?>
841 841
 
842 842
                     <?php /*if(!in_array($field_type,array() )){?>
843 843
 				<tr>
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
26 26
 
27
-$nonce = wp_create_nonce('custom_fields_' . $result_str);
27
+$nonce = wp_create_nonce('custom_fields_'.$result_str);
28 28
 
29 29
 $field_admin_title = '';
30 30
 if (isset($field_info->admin_title))
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
48 48
         <?php
49 49
 
50
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
50
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
51 51
         ?>
52 52
 
53 53
         <?php if ($default): ?>
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
             ?>
62 62
 
63 63
             <b style="cursor:pointer;"
64
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
64
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b>
65 65
         <?php
66 66
         } else {
67 67
             ?>
68 68
             <b style="cursor:pointer;"
69
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' ' . $field_admin_title . ' (' . $field_type . ')');?></b>
69
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' '.$field_admin_title.' ('.$field_type.')'); ?></b>
70 70
         <?php
71 71
         }
72 72
         ?>
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                 ?>
173 173
 
174 174
                 <tr>
175
-                    <td><strong><?php _e('HTML variable name :', 'geodirectory');?></strong></td>
175
+                    <td><strong><?php _e('HTML variable name :', 'geodirectory'); ?></strong></td>
176 176
                     <td align="left">
177 177
                         <input type="text" name="htmlvar_name" id="htmlvar_name"
178 178
                                value="<?php if (isset($field_info->htmlvar_name)) {
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
                                }?>" <?php if ($default) {
181 181
                             echo 'readonly="readonly"';
182 182
                         }?> />
183
-                        <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory');?></span>
184
-                        <br/> <span><?php _e('This should be a unique name', 'geodirectory');?></span>
183
+                        <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory'); ?></span>
184
+                        <br/> <span><?php _e('This should be a unique name', 'geodirectory'); ?></span>
185 185
                         <br/>
186
-                        <span><?php _e('HTML variable name not use spaces, special characters', 'geodirectory');?></span>
186
+                        <span><?php _e('HTML variable name not use spaces, special characters', 'geodirectory'); ?></span>
187 187
                     </td>
188 188
                 </tr>
189 189
             <?php } ?>
@@ -202,19 +202,19 @@  discard block
 block discarded – undo
202 202
 				$default_value = isset($field_info->default_value) ? $field_info->default_value : '';
203 203
 			?>
204 204
 			<tr>
205
-				<td><strong><?php _e('Default value :', 'geodirectory');?></strong></td>
205
+				<td><strong><?php _e('Default value :', 'geodirectory'); ?></strong></td>
206 206
 				<td align="left">
207 207
 				<?php if ($field_type == 'checkbox') { ?>
208 208
 				<select name="default_value" id="default_value">
209 209
 					<option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
210
-					<option value="1" <?php selected(true, (int)$default_value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
210
+					<option value="1" <?php selected(true, (int) $default_value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
211 211
 				</select>
212 212
 				<?php } else if ($field_type == 'email') { ?>
213
-				<input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($default_value);?>" /><br/>
214
-				<span><?php _e('Enter the default value. Ex: [email protected]', 'geodirectory');?></span>
213
+				<input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($default_value); ?>" /><br/>
214
+				<span><?php _e('Enter the default value. Ex: [email protected]', 'geodirectory'); ?></span>
215 215
 				<?php } else { ?>
216
-				<input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($default_value);?>" /><br/>
217
-				<span><?php _e('Enter the default value (for "link" this will be used as the link text)', 'geodirectory');?></span>
216
+				<input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($default_value); ?>" /><br/>
217
+				<span><?php _e('Enter the default value (for "link" this will be used as the link text)', 'geodirectory'); ?></span>
218 218
 				<?php } ?>
219 219
 				</td>
220 220
 			</tr>
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                 </td>
380 380
             </tr>
381 381
 
382
-            <?php if ($field_type == 'text'){?>
382
+            <?php if ($field_type == 'text') {?>
383 383
             <tr>
384 384
                 <td><strong><?php _e('Validation Pattern:', 'geodirectory'); ?></strong></td>
385 385
                 <td align="left">
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
             </tr>
410 410
             <?php } ?>
411 411
 
412
-            <tr <?php echo (!$display_on_listing ? 'style="display:none"' : '') ;?>>
412
+            <tr <?php echo (!$display_on_listing ? 'style="display:none"' : ''); ?>>
413 413
                 <td><strong><?php _e('Show on listing page ? :', 'geodirectory'); ?></strong></td>
414 414
                 <td align="left">
415 415
                     <select name="show_on_listing" id="show_on_listing">
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 case 'taxonomy': {
469 469
                     ?>
470 470
                     <tr>
471
-                        <td><strong><?php _e('Select taxonomy:', 'geodirectory');?></strong></td>
471
+                        <td><strong><?php _e('Select taxonomy:', 'geodirectory'); ?></strong></td>
472 472
                         <td align="left">
473 473
                             <select name="htmlvar_name" id="htmlvar_name">
474 474
                                 <?php
@@ -478,40 +478,40 @@  discard block
 block discarded – undo
478 478
                                     ?>
479 479
                                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
480 480
                                         echo 'selected="selected"';
481
-                                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
481
+                                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
482 482
                                 }
483 483
                                 ?>
484 484
                             </select>
485 485
 
486 486
                             <br/>
487
-                            <span><?php _e('Selected taxonomy name use as field name index. ex:-( post_category[gd_placecategory] )', 'geodirectory');?></span>
487
+                            <span><?php _e('Selected taxonomy name use as field name index. ex:-( post_category[gd_placecategory] )', 'geodirectory'); ?></span>
488 488
                         </td>
489 489
                     </tr>
490 490
 
491 491
                     <tr>
492
-                        <td><strong><?php _e('Category display type :', 'geodirectory');?></strong></td>
492
+                        <td><strong><?php _e('Category display type :', 'geodirectory'); ?></strong></td>
493 493
                         <td align="left">
494 494
 
495 495
                             <select name="cat_display_type" id="cat_display_type">
496 496
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
497 497
                                     echo 'selected="selected"';
498
-                                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
498
+                                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
499 499
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
500 500
                                     echo 'selected="selected"';
501
-                                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
501
+                                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
502 502
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
503 503
                                     echo 'selected="selected"';
504
-                                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
504
+                                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
505 505
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
506 506
                                     echo 'selected="selected"';
507
-                                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
507
+                                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
508 508
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
509 509
                                     echo 'selected="selected"';
510
-                                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
510
+                                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
511 511
                             </select>
512 512
 
513 513
                             <br/>
514
-                            <span><?php _e('Show categories list as select,multiselect,checkbox or radio', 'geodirectory');?></span>
514
+                            <span><?php _e('Show categories list as select,multiselect,checkbox or radio', 'geodirectory'); ?></span>
515 515
                         </td>
516 516
                     </tr>
517 517
                 <?php } // end of additional field for taxonomy field type
@@ -532,92 +532,92 @@  discard block
 block discarded – undo
532 532
                     do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
533 533
 
534 534
                     <tr>
535
-                        <td><strong><?php _e('Display zip/post code :', 'geodirectory');?></strong></td>
535
+                        <td><strong><?php _e('Display zip/post code :', 'geodirectory'); ?></strong></td>
536 536
                         <td align="left">
537 537
                             <input type="checkbox" name="extra[show_zip]" id="show_zip"
538 538
                                    value="1" <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
539 539
                                 echo 'checked="checked"';
540 540
                             }?>/>
541
-                            <span><?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?></span>
541
+                            <span><?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?></span>
542 542
                         </td>
543 543
                     </tr>
544 544
 
545 545
                     <tr>
546
-                        <td><strong><?php _e('Zip/Post code label :', 'geodirectory');?></strong></td>
546
+                        <td><strong><?php _e('Zip/Post code label :', 'geodirectory'); ?></strong></td>
547 547
                         <td align="left">
548 548
                             <input type="text" name="extra[zip_lable]" id="zip_lable"
549 549
                                    value="<?php if (isset($address['zip_lable'])) {
550 550
                                        echo esc_attr($address['zip_lable']);
551 551
                                    }?>"/>
552
-                            <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory');?></span>
552
+                            <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?></span>
553 553
                         </td>
554 554
                     </tr>
555 555
 
556 556
                     <tr style="display:none;">
557
-                        <td><strong><?php _e('Display map :', 'geodirectory');?></strong></td>
557
+                        <td><strong><?php _e('Display map :', 'geodirectory'); ?></strong></td>
558 558
                         <td align="left">
559 559
                             <input type="checkbox" name="extra[show_map]" id="show_map"
560 560
                                    value="1" <?php if (isset($address['show_map']) && $address['show_map'] == '1') {
561 561
                                 echo 'checked="checked"';
562 562
                             }?>/>
563
-                            <span><?php _e('Select if you want to `set address on map` field in address section.', 'geodirectory');?></span>
563
+                            <span><?php _e('Select if you want to `set address on map` field in address section.', 'geodirectory'); ?></span>
564 564
                         </td>
565 565
                     </tr>
566 566
 
567 567
                     <tr>
568
-                        <td><strong><?php _e('Map button label :', 'geodirectory');?></strong></td>
568
+                        <td><strong><?php _e('Map button label :', 'geodirectory'); ?></strong></td>
569 569
                         <td align="left">
570 570
                             <input type="text" name="extra[map_lable]" id="map_lable"
571 571
                                    value="<?php if (isset($address['map_lable'])) {
572 572
                                        echo esc_attr($address['map_lable']);
573 573
                                    }?>"/>
574
-                            <span><?php _e('Enter text for  `set address on map` button in address section.', 'geodirectory');?></span>
574
+                            <span><?php _e('Enter text for  `set address on map` button in address section.', 'geodirectory'); ?></span>
575 575
                         </td>
576 576
                     </tr>
577 577
 
578 578
                     <tr>
579
-                        <td><strong><?php _e('Use user zoom level:', 'geodirectory');?></strong></td>
579
+                        <td><strong><?php _e('Use user zoom level:', 'geodirectory'); ?></strong></td>
580 580
                         <td align="left">
581 581
                             <input type="checkbox" name="extra[show_mapzoom]" id="show_mapzoom"
582 582
                                    value="1" <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
583 583
                                 echo 'checked="checked"';
584 584
                             }?>/>
585
-                            <span><?php _e('Select if you want to use the user defined map zoom level.', 'geodirectory');?></span>
585
+                            <span><?php _e('Select if you want to use the user defined map zoom level.', 'geodirectory'); ?></span>
586 586
                         </td>
587 587
                     </tr>
588 588
 
589 589
                     <tr>
590
-                        <td><strong><?php _e('Display map view:', 'geodirectory');?></strong></td>
590
+                        <td><strong><?php _e('Display map view:', 'geodirectory'); ?></strong></td>
591 591
                         <td align="left">
592 592
                             <input type="checkbox" name="extra[show_mapview]" id="show_mapview"
593 593
                                    value="1" <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
594 594
                                 echo 'checked="checked"';
595 595
                             }?>/>
596
-                            <span><?php _e('Select if you want to `set default map` options in address section.', 'geodirectory');?></span>
596
+                            <span><?php _e('Select if you want to `set default map` options in address section.', 'geodirectory'); ?></span>
597 597
                         </td>
598 598
                     </tr>
599 599
 
600 600
 
601 601
                     <tr>
602
-                        <td><strong><?php _e('Map view label :', 'geodirectory');?></strong></td>
602
+                        <td><strong><?php _e('Map view label :', 'geodirectory'); ?></strong></td>
603 603
                         <td align="left">
604 604
                             <input type="text" name="extra[mapview_lable]" id="mapview_lable"
605 605
                                    value="<?php if (isset($address['mapview_lable'])) {
606 606
                                        echo esc_attr($address['mapview_lable']);
607 607
                                    }?>"/>
608
-                            <span><?php _e('Enter mapview field label in address section.', 'geodirectory');?></span>
608
+                            <span><?php _e('Enter mapview field label in address section.', 'geodirectory'); ?></span>
609 609
                         </td>
610 610
                     </tr>
611 611
                     <tr>
612 612
                         <td>
613
-                            <strong><?php _e('Show latitude and longitude from front-end :', 'geodirectory');?></strong>
613
+                            <strong><?php _e('Show latitude and longitude from front-end :', 'geodirectory'); ?></strong>
614 614
                         </td>
615 615
                         <td align="left">
616 616
                             <input type="checkbox" name="extra[show_latlng]" id="show_latlng"
617 617
                                    value="1" <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
618 618
                                 echo 'checked="checked"';
619 619
                             }?>/>
620
-                            <span><?php _e('Select if you want to show latitude and logatude fields in address section from front-end.', 'geodirectory');?></span>
620
+                            <span><?php _e('Select if you want to show latitude and logatude fields in address section from front-end.', 'geodirectory'); ?></span>
621 621
                         </td>
622 622
                     </tr>
623 623
                 <?php } // end of extra fields for address field type
@@ -629,41 +629,41 @@  discard block
 block discarded – undo
629 629
 
630 630
                         ?>
631 631
                         <tr>
632
-                            <td><strong><?php _e('Multiselect display type :', 'geodirectory');?></strong></td>
632
+                            <td><strong><?php _e('Multiselect display type :', 'geodirectory'); ?></strong></td>
633 633
                             <td align="left">
634 634
 
635 635
                                 <select name="multi_display_type" id="multi_display_type">
636 636
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
637 637
                                         echo 'selected="selected"';
638
-                                    }?> value="select"><?php _e('Select', 'geodirectory');?></option>
638
+                                    }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
639 639
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
640 640
                                         echo 'selected="selected"';
641
-                                    }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
641
+                                    }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
642 642
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
643 643
                                         echo 'selected="selected"';
644
-                                    }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
644
+                                    }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
645 645
                                 </select>
646 646
 
647 647
                                 <br/>
648
-                                <span><?php _e('Show multiselect list as multiselect,checkbox or radio', 'geodirectory');?></span>
648
+                                <span><?php _e('Show multiselect list as multiselect,checkbox or radio', 'geodirectory'); ?></span>
649 649
                             </td>
650 650
                         </tr>
651 651
                     <?php
652 652
                     }
653 653
                     ?>
654 654
                     <tr>
655
-                        <td><strong><?php _e('Option Values :', 'geodirectory');?></strong></td>
655
+                        <td><strong><?php _e('Option Values :', 'geodirectory'); ?></strong></td>
656 656
                         <td align="left">
657 657
                             <input type="text" name="option_values" id="option_values"
658 658
                                    value="<?php if (isset($field_info->option_values)) {
659 659
                                        echo esc_attr($field_info->option_values);
660 660
                                    }?>"/>
661 661
                             <br/>
662
-                            <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
662
+                            <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
663 663
                             <br/>
664
-                            <span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
664
+                            <span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
665 665
                             <br/>
666
-                            <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
666
+                            <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
667 667
                             <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
668 668
                                 <br/>
669 669
                                 <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
                     }
682 682
                     ?>
683 683
                     <tr>
684
-                        <td><strong><?php _e('Date Format :', 'geodirectory');?></strong></td>
684
+                        <td><strong><?php _e('Date Format :', 'geodirectory'); ?></strong></td>
685 685
                         <td align="left" style="overflow:inherit;">
686 686
                             <?php
687 687
                             $date_formats = array(
@@ -699,21 +699,21 @@  discard block
 block discarded – undo
699 699
                              * @since 1.6.5
700 700
                              * @param array $date_formats The PHP date format array.
701 701
                              */
702
-                            $date_formats = apply_filters('geodir_date_formats',$date_formats);
702
+                            $date_formats = apply_filters('geodir_date_formats', $date_formats);
703 703
                             ?>
704 704
                             <select name="extra[date_format]" id="date_format">
705 705
                                 <?php
706
-                                foreach($date_formats as $format){
706
+                                foreach ($date_formats as $format) {
707 707
                                     $selected = '';
708
-                                    if(esc_attr($extra['date_format'])==$format){
708
+                                    if (esc_attr($extra['date_format']) == $format) {
709 709
                                         $selected = "selected='selected'";
710 710
                                     }
711
-                                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
711
+                                    echo "<option $selected value='$format'>$format       (".date_i18n($format, time()).")</option>";
712 712
                                 }
713 713
                                 ?>
714 714
                             </select>
715 715
                             
716
-                            <span><?php _e('Select the date format.', 'geodirectory');?></span>
716
+                            <span><?php _e('Select the date format.', 'geodirectory'); ?></span>
717 717
                         </td>
718 718
                     </tr>
719 719
                 <?php
@@ -726,20 +726,20 @@  discard block
 block discarded – undo
726 726
 					$gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
727 727
 					?>
728 728
 					<tr>
729
-					  <td><strong><?php _e('Allowed file types:', 'geodirectory');?></strong></td>
729
+					  <td><strong><?php _e('Allowed file types:', 'geodirectory'); ?></strong></td>
730 730
 						<td align="left">
731 731
 							<select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
732
-								<option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
733
-								<?php foreach ( $allowed_file_types as $format => $types ) { ?>
734
-								<optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
735
-									<?php foreach ( $types as $ext => $type ) { ?>
736
-									<option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
732
+								<option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
733
+								<?php foreach ($allowed_file_types as $format => $types) { ?>
734
+								<optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
735
+									<?php foreach ($types as $ext => $type) { ?>
736
+									<option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option>
737 737
 									<?php } ?>
738 738
 								</optgroup>
739 739
 								<?php } ?>
740 740
 							</select>			
741 741
 							<br />
742
-							<span><?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', GEODIRPAYMENT_TEXTDOMAIN);?></span>				
742
+							<span><?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', GEODIRPAYMENT_TEXTDOMAIN); ?></span>				
743 743
 						</td>
744 744
 					</tr>
745 745
 					<?php 
@@ -754,28 +754,28 @@  discard block
 block discarded – undo
754 754
                 </tr>
755 755
 
756 756
                 <tr>
757
-                    <td><strong><?php _e('Upload icon:', 'geodirectory');?></strong></td>
757
+                    <td><strong><?php _e('Upload icon:', 'geodirectory'); ?></strong></td>
758 758
                     <td align="left">
759 759
                         <input type="text" name="field_icon" id="field_icon"
760 760
                                value="<?php if (isset($field_info->field_icon)) {
761 761
                                    echo $field_info->field_icon;
762 762
                                }?>"/>
763 763
                     <span>
764
-                        <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
764
+                        <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?>
765 765
                     </span>
766 766
                     </td>
767 767
                     </td>
768 768
                 </tr>
769 769
 
770 770
                 <tr>
771
-                    <td><strong><?php _e('Css class:', 'geodirectory');?></strong></td>
771
+                    <td><strong><?php _e('Css class:', 'geodirectory'); ?></strong></td>
772 772
                     <td align="left">
773 773
                         <input type="text" name="css_class" id="css_class"
774 774
                                value="<?php if (isset($field_info->css_class)) {
775 775
                                    echo esc_attr($field_info->css_class);
776 776
                                }?>"/>
777 777
                     <span>
778
-                        <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
778
+                        <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
779 779
                     </span>
780 780
                     </td>
781 781
                     </td>
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
                      * @since 1.0.0
838 838
                      * @param object $field_info The current fields info.
839 839
                      */
840
-                    do_action('geodir_advance_custom_fields', $field_info);?>
840
+                    do_action('geodir_advance_custom_fields', $field_info); ?>
841 841
 
842 842
                     <?php /*if(!in_array($field_type,array() )){?>
843 843
 				<tr>
@@ -856,10 +856,10 @@  discard block
 block discarded – undo
856 856
                 <td>&nbsp;</td>
857 857
                 <td align="left">
858 858
 
859
-                    <input type="button" class="button" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
859
+                    <input type="button" class="button" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
860 860
                            onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
861 861
                     <?php if (!$default): ?>
862
-                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
862
+                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
863 863
                                                             onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
864 864
                                                             class="button_n"/></a>
865 865
                     <?php endif; ?>
Please login to merge, or discard this patch.
Braces   +17 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,16 +19,18 @@  discard block
 block discarded – undo
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21 21
     $post_type = sanitize_text_field($_REQUEST['listing_type']);
22
-} else
23
-    $post_type = $field_info->post_type;
22
+} else {
23
+    $post_type = $field_info->post_type;
24
+}
24 25
 
25 26
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
26 27
 
27 28
 $nonce = wp_create_nonce('custom_fields_' . $result_str);
28 29
 
29 30
 $field_admin_title = '';
30
-if (isset($field_info->admin_title))
31
-    $field_admin_title = $field_info->admin_title;
31
+if (isset($field_info->admin_title)) {
32
+    $field_admin_title = $field_info->admin_title;
33
+}
32 34
 
33 35
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
34 36
 
@@ -52,8 +54,11 @@  discard block
 block discarded – undo
52 54
 
53 55
         <?php if ($default): ?>
54 56
             <div title="<?php _e('Drag and drop to sort', 'geodirectory'); ?>" class="handlediv move"></div>
55
-        <?php else: ?>
56
-            <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
57
+        <?php else {
58
+	: ?>
59
+            <div title="<?php _e('Click to remove field', 'geodirectory');
60
+}
61
+?>"
57 62
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
58 63
                  class="handlediv close"></div>
59 64
         <?php endif;
@@ -255,11 +260,13 @@  discard block
 block discarded – undo
255 260
 
256 261
                     <?php
257 262
                     $selected = '';
258
-                    if (isset($field_info->extra_fields))
259
-                        $advanced_editor = unserialize($field_info->extra_fields);
263
+                    if (isset($field_info->extra_fields)) {
264
+                                            $advanced_editor = unserialize($field_info->extra_fields);
265
+                    }
260 266
 
261
-                    if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
262
-                        $selected = 'checked="checked"';
267
+                    if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) {
268
+                                            $selected = 'checked="checked"';
269
+                    }
263 270
                     ?>
264 271
 
265 272
                     <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
Please login to merge, or discard this patch.
geodirectory_shortcodes.php 2 patches
Indentation   +676 added lines, -676 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 // If this file is called directly, abort.
9 9
 if (!defined('WPINC')) {
10
-    die;
10
+	die;
11 11
 }
12 12
 require_once('geodirectory-functions/shortcode_functions.php');
13 13
 
@@ -32,48 +32,48 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function geodir_sc_add_listing($atts)
34 34
 {
35
-    ob_start();
36
-    $defaults = array(
37
-        'pid' => '',
38
-        'listing_type' => 'gd_place',
39
-        'login_msg' => __('You must login to post.', 'geodirectory'),
40
-        'show_login' => false,
41
-    );
42
-    $params = shortcode_atts($defaults, $atts);
43
-
44
-    foreach ($params as $key => $value) {
45
-        $_REQUEST[$key] = $value;
46
-    }
47
-
48
-    $user_id = get_current_user_id();
49
-    if (!$user_id) {
50
-        echo $params['login_msg'];
51
-        if ($params['show_login']) {
52
-            echo "<br />";
53
-            $defaults = array(
54
-                'before_widget' => '',
55
-                'after_widget' => '',
56
-                'before_title' => '',
57
-                'after_title' => '',
58
-            );
59
-
60
-            geodir_loginwidget_output($defaults, $defaults);
61
-        }
62
-
63
-
64
-    } else {
65
-        ###### MAIN CONTENT ######
66
-
67
-        /** This action is documented in geodirectory-templates/add-listing.php */
68
-        do_action('geodir_add_listing_page_mandatory');
69
-        /** This action is documented in geodirectory-templates/add-listing.php */
70
-        do_action('geodir_add_listing_form');
71
-    }
72
-    $output = ob_get_contents();
73
-
74
-    ob_end_clean();
75
-
76
-    return $output;
35
+	ob_start();
36
+	$defaults = array(
37
+		'pid' => '',
38
+		'listing_type' => 'gd_place',
39
+		'login_msg' => __('You must login to post.', 'geodirectory'),
40
+		'show_login' => false,
41
+	);
42
+	$params = shortcode_atts($defaults, $atts);
43
+
44
+	foreach ($params as $key => $value) {
45
+		$_REQUEST[$key] = $value;
46
+	}
47
+
48
+	$user_id = get_current_user_id();
49
+	if (!$user_id) {
50
+		echo $params['login_msg'];
51
+		if ($params['show_login']) {
52
+			echo "<br />";
53
+			$defaults = array(
54
+				'before_widget' => '',
55
+				'after_widget' => '',
56
+				'before_title' => '',
57
+				'after_title' => '',
58
+			);
59
+
60
+			geodir_loginwidget_output($defaults, $defaults);
61
+		}
62
+
63
+
64
+	} else {
65
+		###### MAIN CONTENT ######
66
+
67
+		/** This action is documented in geodirectory-templates/add-listing.php */
68
+		do_action('geodir_add_listing_page_mandatory');
69
+		/** This action is documented in geodirectory-templates/add-listing.php */
70
+		do_action('geodir_add_listing_form');
71
+	}
72
+	$output = ob_get_contents();
73
+
74
+	ob_end_clean();
75
+
76
+	return $output;
77 77
 }
78 78
 
79 79
 /**
@@ -101,136 +101,136 @@  discard block
 block discarded – undo
101 101
  */
102 102
 function geodir_sc_home_map($atts)
103 103
 {
104
-    ob_start();
105
-    $defaults = array(
106
-        'width' => '960',
107
-        'height' => '425',
108
-        'maptype' => 'ROADMAP',
109
-        'zoom' => '13',
110
-        'autozoom' => '',
111
-        'child_collapse' => '0',
112
-        'scrollwheel' => '0',
104
+	ob_start();
105
+	$defaults = array(
106
+		'width' => '960',
107
+		'height' => '425',
108
+		'maptype' => 'ROADMAP',
109
+		'zoom' => '13',
110
+		'autozoom' => '',
111
+		'child_collapse' => '0',
112
+		'scrollwheel' => '0',
113 113
 		'marker_cluster' => false,
114
-        'latitude' => '',
115
-        'longitude' => ''
116
-    );
117
-
118
-    $params = shortcode_atts($defaults, $atts);
119
-
120
-    $params = gdsc_validate_map_args($params);
121
-
122
-    $map_args = array(
123
-        'map_canvas_name' => 'gd_home_map',
124
-        'latitude' => $params['latitude'],
125
-        'longitude' => $params['longitude'],
126
-
127
-        /**
128
-         * Filter the widget width of the map on home/listings page.
129
-         *
130
-         * @since 1.0.0
131
-         * @param mixed(string|int|float) $params['width'] The map width.
132
-         */
133
-        'width' => apply_filters('widget_width', $params['width']),
134
-        /**
135
-         * Filter the widget height of the map on home/listings page.
136
-         *
137
-         * @since 1.0.0
138
-         * @param mixed(string|int|float) $params['height'] The map height.
139
-         */
140
-        'height' => apply_filters('widget_heigh', $params['height']),
141
-        /**
142
-         * Filter the widget maptype of the map on home/listings page.
143
-         *
144
-         * @since 1.0.0
114
+		'latitude' => '',
115
+		'longitude' => ''
116
+	);
117
+
118
+	$params = shortcode_atts($defaults, $atts);
119
+
120
+	$params = gdsc_validate_map_args($params);
121
+
122
+	$map_args = array(
123
+		'map_canvas_name' => 'gd_home_map',
124
+		'latitude' => $params['latitude'],
125
+		'longitude' => $params['longitude'],
126
+
127
+		/**
128
+		 * Filter the widget width of the map on home/listings page.
129
+		 *
130
+		 * @since 1.0.0
131
+		 * @param mixed(string|int|float) $params['width'] The map width.
132
+		 */
133
+		'width' => apply_filters('widget_width', $params['width']),
134
+		/**
135
+		 * Filter the widget height of the map on home/listings page.
136
+		 *
137
+		 * @since 1.0.0
138
+		 * @param mixed(string|int|float) $params['height'] The map height.
139
+		 */
140
+		'height' => apply_filters('widget_heigh', $params['height']),
141
+		/**
142
+		 * Filter the widget maptype of the map on home/listings page.
143
+		 *
144
+		 * @since 1.0.0
145 145
 		 * @since 1.5.2 Added TERRAIN map type.
146
-         * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
147
-         */
148
-        'maptype' => apply_filters('widget_maptype', $params['maptype']),
149
-        /**
150
-         * Filter the widget scrollwheel value of the map on home/listings page.
151
-         *
152
-         * Should the scrollwheel zoom the map or not.
153
-         *
154
-         * @since 1.0.0
155
-         * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
156
-         */
157
-        'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
158
-        /**
159
-         * Filter the widget zoom level of the map on home/listings page.
160
-         *
161
-         * @since 1.0.0
162
-         * @param int $params['zoom'] The zoom level of the map. Between 1-19.
163
-         */
164
-        'zoom' => apply_filters('widget_zoom', $params['zoom']),
165
-        /**
166
-         * Filter the widget auto zoom value of the map on home/listings page.
167
-         *
168
-         * If the map should autozoom to fit the markers shown.
169
-         *
170
-         * @since 1.0.0
171
-         * @param bool $params['autozoom'] True if the map should autozoom, false if not.
172
-         */
173
-        'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
174
-        /**
175
-         * Filter the widget child_collapse value of the map on home/listings page.
176
-         *
177
-         * If the map should auto collapse the child categories if the category bar is present.
178
-         *
179
-         * @since 1.0.0
180
-         * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
181
-         */
182
-        'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
183
-        'enable_cat_filters' => true,
184
-        'enable_text_search' => true,
185
-        'enable_post_type_filters' => true,
186
-        /**
187
-         * Filter the widget enable_location_filters value of the map on home/listings page.
188
-         *
189
-         * This is used when the location addon is used.
190
-         *
191
-         * @since 1.0.0
192
-         * @param bool $val True if location filters should be used, false if not.
193
-         */
194
-        'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
195
-        'enable_jason_on_load' => false,
196
-        'enable_marker_cluster' => false,
197
-        'enable_map_resize_button' => true,
198
-        'map_class_name' => 'geodir-map-home-page',
199
-        'is_geodir_home_map_widget' => true,
200
-    );
146
+		 * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
147
+		 */
148
+		'maptype' => apply_filters('widget_maptype', $params['maptype']),
149
+		/**
150
+		 * Filter the widget scrollwheel value of the map on home/listings page.
151
+		 *
152
+		 * Should the scrollwheel zoom the map or not.
153
+		 *
154
+		 * @since 1.0.0
155
+		 * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
156
+		 */
157
+		'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
158
+		/**
159
+		 * Filter the widget zoom level of the map on home/listings page.
160
+		 *
161
+		 * @since 1.0.0
162
+		 * @param int $params['zoom'] The zoom level of the map. Between 1-19.
163
+		 */
164
+		'zoom' => apply_filters('widget_zoom', $params['zoom']),
165
+		/**
166
+		 * Filter the widget auto zoom value of the map on home/listings page.
167
+		 *
168
+		 * If the map should autozoom to fit the markers shown.
169
+		 *
170
+		 * @since 1.0.0
171
+		 * @param bool $params['autozoom'] True if the map should autozoom, false if not.
172
+		 */
173
+		'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
174
+		/**
175
+		 * Filter the widget child_collapse value of the map on home/listings page.
176
+		 *
177
+		 * If the map should auto collapse the child categories if the category bar is present.
178
+		 *
179
+		 * @since 1.0.0
180
+		 * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
181
+		 */
182
+		'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
183
+		'enable_cat_filters' => true,
184
+		'enable_text_search' => true,
185
+		'enable_post_type_filters' => true,
186
+		/**
187
+		 * Filter the widget enable_location_filters value of the map on home/listings page.
188
+		 *
189
+		 * This is used when the location addon is used.
190
+		 *
191
+		 * @since 1.0.0
192
+		 * @param bool $val True if location filters should be used, false if not.
193
+		 */
194
+		'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
195
+		'enable_jason_on_load' => false,
196
+		'enable_marker_cluster' => false,
197
+		'enable_map_resize_button' => true,
198
+		'map_class_name' => 'geodir-map-home-page',
199
+		'is_geodir_home_map_widget' => true,
200
+	);
201 201
 
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204
-        $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
206
-            if ($map_args['autozoom']) {
207
-                $map_args['enable_marker_cluster_no_reposition'] = false;
208
-            } else {
209
-                $map_args['enable_marker_cluster_no_reposition'] = true;
210
-            }
204
+		$map_args['enable_marker_cluster'] = true;
205
+		if(get_option('geodir_marker_cluster_type')) {
206
+			if ($map_args['autozoom']) {
207
+				$map_args['enable_marker_cluster_no_reposition'] = false;
208
+			} else {
209
+				$map_args['enable_marker_cluster_no_reposition'] = true;
210
+			}
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+			$map_args['enable_marker_cluster_server'] = true ;
213 213
 
214
-        }
214
+		}
215 215
 	} else {
216 216
 		$map_args['enable_marker_cluster'] = false;
217 217
 	}
218 218
 
219
-    // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
221
-        $map_args['enable_marker_cluster_no_reposition'] = true;
222
-    }
219
+	// if lat and long set in shortcode, hack it so the map is not repositioned
220
+	if(!empty($params['latitude']) && !empty($params['longitude']) ){
221
+		$map_args['enable_marker_cluster_no_reposition'] = true;
222
+	}
223 223
 
224 224
 
225
-    geodir_draw_map($map_args);
225
+	geodir_draw_map($map_args);
226 226
 
227
-    add_action('wp_footer', 'geodir_home_map_add_script', 100);
227
+	add_action('wp_footer', 'geodir_home_map_add_script', 100);
228 228
 
229
-    $output = ob_get_contents();
229
+	$output = ob_get_contents();
230 230
 
231
-    ob_end_clean();
231
+	ob_end_clean();
232 232
 
233
-    return $output;
233
+	return $output;
234 234
 }
235 235
 add_shortcode('gd_homepage_map', 'geodir_sc_home_map');
236 236
 
@@ -264,77 +264,77 @@  discard block
 block discarded – undo
264 264
  */
265 265
 function geodir_sc_listing_map($atts)
266 266
 {
267
-    ob_start();
268
-    add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
269
-
270
-    add_action('the_post', 'create_list_jsondata'); // Add marker in json array
271
-
272
-    add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
273
-
274
-    $defaults = array(
275
-        'width' => '294',
276
-        'height' => '370',
277
-        'zoom' => '13',
278
-        'autozoom' => '',
279
-        'sticky' => '',
280
-        'showall' => '0',
281
-        'scrollwheel' => '0',
282
-        'maptype' => 'ROADMAP',
283
-        'child_collapse' => 0,
267
+	ob_start();
268
+	add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
269
+
270
+	add_action('the_post', 'create_list_jsondata'); // Add marker in json array
271
+
272
+	add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
273
+
274
+	$defaults = array(
275
+		'width' => '294',
276
+		'height' => '370',
277
+		'zoom' => '13',
278
+		'autozoom' => '',
279
+		'sticky' => '',
280
+		'showall' => '0',
281
+		'scrollwheel' => '0',
282
+		'maptype' => 'ROADMAP',
283
+		'child_collapse' => 0,
284 284
 		'marker_cluster' => false
285
-    );
286
-
287
-    $params = shortcode_atts($defaults, $atts);
288
-
289
-    $params = gdsc_validate_map_args($params);
290
-
291
-    $map_args = array(
292
-        'map_canvas_name' => 'gd_listing_map',
293
-        'width' => $params['width'],
294
-        'height' => $params['height'],
295
-        'zoom' => $params['zoom'],
296
-        'autozoom' => $params['autozoom'],
297
-        'sticky' => $params['sticky'],
298
-        'showall' => $params['showall'],
299
-        'scrollwheel' => $params['scrollwheel'],
300
-        'child_collapse' => 0,
301
-        'enable_cat_filters' => false,
302
-        'enable_text_search' => false,
303
-        'enable_post_type_filters' => false,
304
-        'enable_location_filters' => false,
305
-        'enable_jason_on_load' => true,
306
-    );
307
-
308
-    if (is_single()) {
309
-
310
-        global $post;
311
-        $map_default_lat = $address_latitude = $post->post_latitude;
312
-        $map_default_lng = $address_longitude = $post->post_longitude;
313
-        $mapview = $post->post_mapview;
314
-        $map_args['zoom'] = $post->post_mapzoom;
315
-        $map_args['map_class_name'] = 'geodir-map-listing-page-single';
316
-
317
-    } else {
318
-        $default_location = geodir_get_default_location();
319
-
320
-        $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
321
-        $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
322
-        $map_args['map_class_name'] = 'geodir-map-listing-page';
323
-    }
324
-
325
-    if (empty($mapview)) {
326
-        $mapview = 'ROADMAP';
327
-    }
328
-
329
-    // Set default map options
330
-    $map_args['ajax_url'] = geodir_get_ajax_url();
331
-    $map_args['latitude'] = $map_default_lat;
332
-    $map_args['longitude'] = $map_default_lng;
333
-    $map_args['streetViewControl'] = true;
334
-    $map_args['maptype'] = $mapview;
335
-    $map_args['showPreview'] = '0';
336
-    $map_args['maxZoom'] = 21;
337
-    $map_args['bubble_size'] = 'small';
285
+	);
286
+
287
+	$params = shortcode_atts($defaults, $atts);
288
+
289
+	$params = gdsc_validate_map_args($params);
290
+
291
+	$map_args = array(
292
+		'map_canvas_name' => 'gd_listing_map',
293
+		'width' => $params['width'],
294
+		'height' => $params['height'],
295
+		'zoom' => $params['zoom'],
296
+		'autozoom' => $params['autozoom'],
297
+		'sticky' => $params['sticky'],
298
+		'showall' => $params['showall'],
299
+		'scrollwheel' => $params['scrollwheel'],
300
+		'child_collapse' => 0,
301
+		'enable_cat_filters' => false,
302
+		'enable_text_search' => false,
303
+		'enable_post_type_filters' => false,
304
+		'enable_location_filters' => false,
305
+		'enable_jason_on_load' => true,
306
+	);
307
+
308
+	if (is_single()) {
309
+
310
+		global $post;
311
+		$map_default_lat = $address_latitude = $post->post_latitude;
312
+		$map_default_lng = $address_longitude = $post->post_longitude;
313
+		$mapview = $post->post_mapview;
314
+		$map_args['zoom'] = $post->post_mapzoom;
315
+		$map_args['map_class_name'] = 'geodir-map-listing-page-single';
316
+
317
+	} else {
318
+		$default_location = geodir_get_default_location();
319
+
320
+		$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
321
+		$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
322
+		$map_args['map_class_name'] = 'geodir-map-listing-page';
323
+	}
324
+
325
+	if (empty($mapview)) {
326
+		$mapview = 'ROADMAP';
327
+	}
328
+
329
+	// Set default map options
330
+	$map_args['ajax_url'] = geodir_get_ajax_url();
331
+	$map_args['latitude'] = $map_default_lat;
332
+	$map_args['longitude'] = $map_default_lng;
333
+	$map_args['streetViewControl'] = true;
334
+	$map_args['maptype'] = $mapview;
335
+	$map_args['showPreview'] = '0';
336
+	$map_args['maxZoom'] = 21;
337
+	$map_args['bubble_size'] = 'small';
338 338
 	
339 339
 	// Add marker cluster
340 340
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
@@ -343,13 +343,13 @@  discard block
 block discarded – undo
343 343
 		$map_args['enable_marker_cluster'] = false;
344 344
 	}
345 345
 
346
-    geodir_draw_map($map_args);
346
+	geodir_draw_map($map_args);
347 347
 
348
-    $output = ob_get_contents();
348
+	$output = ob_get_contents();
349 349
 
350
-    ob_end_clean();
350
+	ob_end_clean();
351 351
 
352
-    return $output;
352
+	return $output;
353 353
 }
354 354
 
355 355
 add_shortcode('gd_listing_slider', 'geodir_sc_listing_slider');
@@ -382,120 +382,120 @@  discard block
 block discarded – undo
382 382
  */
383 383
 function geodir_sc_listing_slider($atts)
384 384
 {
385
-    ob_start();
386
-    $defaults = array(
387
-        'post_type' => 'gd_place',
388
-        'category' => '0',
389
-        'post_number' => '5',
390
-        'slideshow' => '0',
391
-        'animation_loop' => 0,
392
-        'direction_nav' => 0,
393
-        'slideshow_speed' => 5000,
394
-        'animation_speed' => 600,
395
-        'animation' => 'slide',
396
-        'order_by' => 'latest',
397
-        'show_title' => '',
398
-        'show_featured_only' => '',
399
-        'title' => '',
400
-    );
401
-
402
-    $params = shortcode_atts($defaults, $atts);
403
-
404
-
405
-    /*
385
+	ob_start();
386
+	$defaults = array(
387
+		'post_type' => 'gd_place',
388
+		'category' => '0',
389
+		'post_number' => '5',
390
+		'slideshow' => '0',
391
+		'animation_loop' => 0,
392
+		'direction_nav' => 0,
393
+		'slideshow_speed' => 5000,
394
+		'animation_speed' => 600,
395
+		'animation' => 'slide',
396
+		'order_by' => 'latest',
397
+		'show_title' => '',
398
+		'show_featured_only' => '',
399
+		'title' => '',
400
+	);
401
+
402
+	$params = shortcode_atts($defaults, $atts);
403
+
404
+
405
+	/*
406 406
      *
407 407
      * Now we begin the validation of the attributes.
408 408
      */
409
-    // Check we have a valid post_type
410
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
411
-        $params['post_type'] = 'gd_place';
412
-    }
413
-
414
-    // Check we have a valid sort_order
415
-    $params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
416
-
417
-    // Match the chosen animation to our options
418
-    $animation_list = array('slide', 'fade');
419
-    if (!(in_array($params['animation'], $animation_list))) {
420
-        $params['animation'] = 'slide';
421
-    }
422
-
423
-    // Post_number needs to be a positive integer
424
-    $params['post_number'] = absint($params['post_number']);
425
-    if (0 == $params['post_number']) {
426
-        $params['post_number'] = 1;
427
-    }
428
-
429
-    // Manage the entered categories
430
-    if (0 != $params['category'] || '' != $params['category']) {
431
-        $params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
432
-    }
433
-    // Convert show_title to a bool
434
-    $params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
435
-
436
-    // Convert show_featured_only to a bool
437
-    $params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
438
-
439
-    /*
409
+	// Check we have a valid post_type
410
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
411
+		$params['post_type'] = 'gd_place';
412
+	}
413
+
414
+	// Check we have a valid sort_order
415
+	$params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
416
+
417
+	// Match the chosen animation to our options
418
+	$animation_list = array('slide', 'fade');
419
+	if (!(in_array($params['animation'], $animation_list))) {
420
+		$params['animation'] = 'slide';
421
+	}
422
+
423
+	// Post_number needs to be a positive integer
424
+	$params['post_number'] = absint($params['post_number']);
425
+	if (0 == $params['post_number']) {
426
+		$params['post_number'] = 1;
427
+	}
428
+
429
+	// Manage the entered categories
430
+	if (0 != $params['category'] || '' != $params['category']) {
431
+		$params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
432
+	}
433
+	// Convert show_title to a bool
434
+	$params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
435
+
436
+	// Convert show_featured_only to a bool
437
+	$params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
438
+
439
+	/*
440 440
      * Hopefully all attributes are now valid, and safe to pass forward
441 441
      */
442 442
 
443
-    // redeclare vars after validation
444
-
445
-    if (isset($params['direction_nav'])) {
446
-        $params['directionNav'] = $params['direction_nav'];
447
-    }
448
-    if (isset($params['animation_loop'])) {
449
-        $params['animationLoop'] = $params['animation_loop'];
450
-    }
451
-    if (isset($params['slideshow_speed'])) {
452
-        $params['slideshowSpeed'] = $params['slideshow_speed'];
453
-    }
454
-    if (isset($params['animation_speed'])) {
455
-        $params['animationSpeed'] = $params['animation_speed'];
456
-    }
457
-    if (isset($params['order_by'])) {
458
-        $params['list_sort'] = $params['order_by'];
459
-    }
460
-
461
-    $query_args = array(
462
-        'post_number' => $params['post_number'],
463
-        'is_geodir_loop' => true,
464
-        'post_type' => $params['post_type'],
465
-        'order_by' => $params['order_by']
466
-    );
467
-
468
-    if (1 == $params['show_featured_only']) {
469
-        $query_args['show_featured_only'] = 1;
470
-    }
471
-
472
-    if (0 != $params['category'] && '' != $params['category']) {
473
-        $category_taxonomy = geodir_get_taxonomies($params['post_type']);
474
-        $tax_query = array(
475
-            'taxonomy' => $category_taxonomy[0],
476
-            'field' => 'id',
477
-            'terms' => $params['category'],
478
-        );
479
-
480
-        $query_args['tax_query'] = array($tax_query);
481
-    }
482
-
483
-    $defaults = array(
484
-        'before_widget' => '',
485
-        'after_widget' => '',
486
-        'before_title' => '',
487
-        'after_title' => '',
488
-    );
489
-
490
-    $query_args = array_merge($query_args, $params);
491
-
492
-    geodir_listing_slider_widget_output($defaults, $query_args);
493
-
494
-    $output = ob_get_contents();
495
-
496
-    ob_end_clean();
497
-
498
-    return $output;
443
+	// redeclare vars after validation
444
+
445
+	if (isset($params['direction_nav'])) {
446
+		$params['directionNav'] = $params['direction_nav'];
447
+	}
448
+	if (isset($params['animation_loop'])) {
449
+		$params['animationLoop'] = $params['animation_loop'];
450
+	}
451
+	if (isset($params['slideshow_speed'])) {
452
+		$params['slideshowSpeed'] = $params['slideshow_speed'];
453
+	}
454
+	if (isset($params['animation_speed'])) {
455
+		$params['animationSpeed'] = $params['animation_speed'];
456
+	}
457
+	if (isset($params['order_by'])) {
458
+		$params['list_sort'] = $params['order_by'];
459
+	}
460
+
461
+	$query_args = array(
462
+		'post_number' => $params['post_number'],
463
+		'is_geodir_loop' => true,
464
+		'post_type' => $params['post_type'],
465
+		'order_by' => $params['order_by']
466
+	);
467
+
468
+	if (1 == $params['show_featured_only']) {
469
+		$query_args['show_featured_only'] = 1;
470
+	}
471
+
472
+	if (0 != $params['category'] && '' != $params['category']) {
473
+		$category_taxonomy = geodir_get_taxonomies($params['post_type']);
474
+		$tax_query = array(
475
+			'taxonomy' => $category_taxonomy[0],
476
+			'field' => 'id',
477
+			'terms' => $params['category'],
478
+		);
479
+
480
+		$query_args['tax_query'] = array($tax_query);
481
+	}
482
+
483
+	$defaults = array(
484
+		'before_widget' => '',
485
+		'after_widget' => '',
486
+		'before_title' => '',
487
+		'after_title' => '',
488
+	);
489
+
490
+	$query_args = array_merge($query_args, $params);
491
+
492
+	geodir_listing_slider_widget_output($defaults, $query_args);
493
+
494
+	$output = ob_get_contents();
495
+
496
+	ob_end_clean();
497
+
498
+	return $output;
499 499
 }
500 500
 
501 501
 add_shortcode('gd_login_box', 'geodir_sc_login_box');
@@ -519,22 +519,22 @@  discard block
 block discarded – undo
519 519
  */
520 520
 function geodir_sc_login_box($atts)
521 521
 {
522
-    ob_start();
522
+	ob_start();
523 523
 
524
-    $defaults = array(
525
-        'before_widget' => '',
526
-        'after_widget' => '',
527
-        'before_title' => '',
528
-        'after_title' => '',
529
-    );
524
+	$defaults = array(
525
+		'before_widget' => '',
526
+		'after_widget' => '',
527
+		'before_title' => '',
528
+		'after_title' => '',
529
+	);
530 530
 
531
-    geodir_loginwidget_output($defaults, $defaults);
531
+	geodir_loginwidget_output($defaults, $defaults);
532 532
 
533
-    $output = ob_get_contents();
533
+	$output = ob_get_contents();
534 534
 
535
-    ob_end_clean();
535
+	ob_end_clean();
536 536
 
537
-    return $output;
537
+	return $output;
538 538
 }
539 539
 
540 540
 add_shortcode('gd_popular_post_category', 'geodir_sc_popular_post_category');
@@ -563,28 +563,28 @@  discard block
 block discarded – undo
563 563
  */
564 564
 function geodir_sc_popular_post_category($atts)
565 565
 {
566
-    ob_start();
567
-    global $geodir_post_category_str;
568
-    $defaults = array(
569
-        'category_limit' => 15,
570
-        'before_widget' => '',
571
-        'after_widget' => '',
572
-        'before_title' => '',
573
-        'after_title' => '',
574
-        'title' => '',
566
+	ob_start();
567
+	global $geodir_post_category_str;
568
+	$defaults = array(
569
+		'category_limit' => 15,
570
+		'before_widget' => '',
571
+		'after_widget' => '',
572
+		'before_title' => '',
573
+		'after_title' => '',
574
+		'title' => '',
575 575
 		'default_post_type' => '',
576
-    );
576
+	);
577 577
 
578
-    $params = shortcode_atts($defaults, $atts, 'popular_post_category');
579
-    $params['category_limit'] = absint($params['category_limit']);
578
+	$params = shortcode_atts($defaults, $atts, 'popular_post_category');
579
+	$params['category_limit'] = absint($params['category_limit']);
580 580
 	$params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
581
-    geodir_popular_post_category_output($params, $params);
581
+	geodir_popular_post_category_output($params, $params);
582 582
 
583
-    $output = ob_get_contents();
583
+	$output = ob_get_contents();
584 584
 
585
-    ob_end_clean();
585
+	ob_end_clean();
586 586
 
587
-    return $output;
587
+	return $output;
588 588
 }
589 589
 
590 590
 add_shortcode('gd_popular_post_view', 'geodir_sc_popular_post_view');
@@ -624,97 +624,97 @@  discard block
 block discarded – undo
624 624
  */
625 625
 function geodir_sc_popular_post_view($atts)
626 626
 {
627
-    ob_start();
628
-    $defaults = array(
629
-        'post_type' => 'gd_place',
630
-        'category' => '0',
631
-        'post_number' => '5',
632
-        'layout' => 'gridview_onehalf',
633
-        'add_location_filter' => '0',
634
-        'list_sort' => 'latest',
635
-        'use_viewing_post_type' => '1',
636
-        'character_count' => '20',
637
-        'listing_width' => '',
638
-        'show_featured_only' => '0',
639
-        'show_special_only' => '0',
640
-        'with_pics_only' => '0',
641
-        'with_videos_only' => '0',
642
-        'before_widget' => '',
643
-        'after_widget' => '',
644
-        'before_title' => '<h3 class="widget-title">',
645
-        'after_title' => '</h3>',
646
-        'title' => '',
647
-        'category_title' => '',
648
-    );
649
-
650
-    $params = shortcode_atts($defaults, $atts);
651
-
652
-    /**
653
-     * Validate our incoming params
654
-     */
627
+	ob_start();
628
+	$defaults = array(
629
+		'post_type' => 'gd_place',
630
+		'category' => '0',
631
+		'post_number' => '5',
632
+		'layout' => 'gridview_onehalf',
633
+		'add_location_filter' => '0',
634
+		'list_sort' => 'latest',
635
+		'use_viewing_post_type' => '1',
636
+		'character_count' => '20',
637
+		'listing_width' => '',
638
+		'show_featured_only' => '0',
639
+		'show_special_only' => '0',
640
+		'with_pics_only' => '0',
641
+		'with_videos_only' => '0',
642
+		'before_widget' => '',
643
+		'after_widget' => '',
644
+		'before_title' => '<h3 class="widget-title">',
645
+		'after_title' => '</h3>',
646
+		'title' => '',
647
+		'category_title' => '',
648
+	);
655 649
 
656
-    // Validate the selected post type, default to gd_place on fail
657
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
658
-        $params['post_type'] = 'gd_place';
659
-    }
660
-
661
-    // Validate the selected category/ies - Grab the current list based on post_type
662
-    $category_taxonomy = geodir_get_taxonomies($params['post_type']);
663
-    $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
664
-
665
-    // Make sure we have an array
666
-    if (!(is_array($params['category']))) {
667
-        $params['category'] = explode(',', $params['category']);
668
-    }
669
-
670
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
671
-    // Otherwise it becomes empty and later on that will mean "All"
672
-    $params['category'] = array_intersect($params['category'], $categories);
673
-
674
-    // Post_number needs to be a positive integer
675
-    $params['post_number'] = absint($params['post_number']);
676
-    if (0 == $params['post_number']) {
677
-        $params['post_number'] = 1;
678
-    }
679
-
680
-    // Validate our layout choice
681
-    // Outside of the norm, I added some more simple terms to match the existing
682
-    // So now I just run the switch to set it properly.
683
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
684
-
685
-    // Validate our sorting choice
686
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
687
-
688
-    // Validate character_count
689
-    $params['character_count'] = absint($params['character_count']);
690
-    if (20 > $params['character_count']) {
691
-        $params['character_count'] = 20;
692
-    }
693
-
694
-    // Validate Listing width, used in the template widget-listing-listview.php
695
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
696
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
697
-
698
-    // Validate the checkboxes used on the widget
699
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
700
-    $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
701
-    $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
702
-    $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
703
-    $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
704
-    $params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
705
-
706
-    /**
707
-     * End of validation
708
-     */
650
+	$params = shortcode_atts($defaults, $atts);
651
+
652
+	/**
653
+	 * Validate our incoming params
654
+	 */
655
+
656
+	// Validate the selected post type, default to gd_place on fail
657
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
658
+		$params['post_type'] = 'gd_place';
659
+	}
660
+
661
+	// Validate the selected category/ies - Grab the current list based on post_type
662
+	$category_taxonomy = geodir_get_taxonomies($params['post_type']);
663
+	$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
664
+
665
+	// Make sure we have an array
666
+	if (!(is_array($params['category']))) {
667
+		$params['category'] = explode(',', $params['category']);
668
+	}
669
+
670
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
671
+	// Otherwise it becomes empty and later on that will mean "All"
672
+	$params['category'] = array_intersect($params['category'], $categories);
673
+
674
+	// Post_number needs to be a positive integer
675
+	$params['post_number'] = absint($params['post_number']);
676
+	if (0 == $params['post_number']) {
677
+		$params['post_number'] = 1;
678
+	}
709 679
 
710
-    geodir_popular_postview_output($params, $params);
680
+	// Validate our layout choice
681
+	// Outside of the norm, I added some more simple terms to match the existing
682
+	// So now I just run the switch to set it properly.
683
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
711 684
 
685
+	// Validate our sorting choice
686
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
712 687
 
713
-    $output = ob_get_contents();
688
+	// Validate character_count
689
+	$params['character_count'] = absint($params['character_count']);
690
+	if (20 > $params['character_count']) {
691
+		$params['character_count'] = 20;
692
+	}
693
+
694
+	// Validate Listing width, used in the template widget-listing-listview.php
695
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
696
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
697
+
698
+	// Validate the checkboxes used on the widget
699
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
700
+	$params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
701
+	$params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
702
+	$params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
703
+	$params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
704
+	$params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
705
+
706
+	/**
707
+	 * End of validation
708
+	 */
714 709
 
715
-    ob_end_clean();
710
+	geodir_popular_postview_output($params, $params);
716 711
 
717
-    return $output;
712
+
713
+	$output = ob_get_contents();
714
+
715
+	ob_end_clean();
716
+
717
+	return $output;
718 718
 }
719 719
 
720 720
 add_shortcode('gd_recent_reviews', 'geodir_sc_recent_reviews');
@@ -736,37 +736,37 @@  discard block
 block discarded – undo
736 736
  * @return string Recent reviews HTML.
737 737
  */
738 738
 function geodir_sc_recent_reviews($atts) {
739
-    ob_start();
740
-    $defaults = array(
739
+	ob_start();
740
+	$defaults = array(
741 741
 		'title' => '',
742 742
 		'count' => 5,
743
-    );
743
+	);
744 744
 
745
-    $params = shortcode_atts($defaults, $atts);
745
+	$params = shortcode_atts($defaults, $atts);
746 746
 
747
-    $count = absint($params['count']);
748
-    if (0 == $count) {
749
-        $count = 1;
750
-    }
747
+	$count = absint($params['count']);
748
+	if (0 == $count) {
749
+		$count = 1;
750
+	}
751 751
 	
752 752
 	$title = !empty($params['title']) ? __($params['title'], 'geodirectory') : '';
753 753
 
754
-    $comments_li = geodir_get_recent_reviews(30, $count, 100, false);
754
+	$comments_li = geodir_get_recent_reviews(30, $count, 100, false);
755 755
 
756
-    if ($comments_li) {
757
-        if ($title != '') { ?>
756
+	if ($comments_li) {
757
+		if ($title != '') { ?>
758 758
 		<h3 class="geodir-sc-recent-reviews-title widget-title"><?php echo $title; ?></h3>
759 759
 		<?php } ?>
760 760
         <div class="geodir_sc_recent_reviews_section">
761 761
             <ul class="geodir_sc_recent_reviews"><?php echo $comments_li; ?></ul>
762 762
         </div>
763 763
     <?php
764
-    }
765
-    $output = ob_get_contents();
764
+	}
765
+	$output = ob_get_contents();
766 766
 
767
-    ob_end_clean();
767
+	ob_end_clean();
768 768
 
769
-    return $output;
769
+	return $output;
770 770
 }
771 771
 
772 772
 add_shortcode('gd_related_listings', 'geodir_sc_related_listings');
@@ -796,64 +796,64 @@  discard block
 block discarded – undo
796 796
  */
797 797
 function geodir_sc_related_listings($atts)
798 798
 {
799
-    ob_start();
800
-    $defaults = array(
801
-        'post_number' => 5,
802
-        'relate_to' => 'category',
803
-        'layout' => 'gridview_onehalf',
804
-        'add_location_filter' => 0,
805
-        'listing_width' => '',
806
-        'list_sort' => 'latest',
807
-        'character_count' => 20,
808
-        'is_widget' => 1,
809
-        'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
810
-    );
811
-    // The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
812
-
813
-    $params = shortcode_atts($defaults, $atts);
814
-
815
-    /**
816
-     * Begin validating parameters
817
-     */
799
+	ob_start();
800
+	$defaults = array(
801
+		'post_number' => 5,
802
+		'relate_to' => 'category',
803
+		'layout' => 'gridview_onehalf',
804
+		'add_location_filter' => 0,
805
+		'listing_width' => '',
806
+		'list_sort' => 'latest',
807
+		'character_count' => 20,
808
+		'is_widget' => 1,
809
+		'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
810
+	);
811
+	// The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
812
+
813
+	$params = shortcode_atts($defaults, $atts);
814
+
815
+	/**
816
+	 * Begin validating parameters
817
+	 */
818 818
 
819
-    // Validate that post_number is a number and is 1 or higher
820
-    $params['post_number'] = absint($params['post_number']);
821
-    if (0 === $params['post_number']) {
822
-        $params['post_number'] = 1;
823
-    }
819
+	// Validate that post_number is a number and is 1 or higher
820
+	$params['post_number'] = absint($params['post_number']);
821
+	if (0 === $params['post_number']) {
822
+		$params['post_number'] = 1;
823
+	}
824 824
 
825
-    // Validate relate_to - only category or tags
826
-    $params['relate_to'] = geodir_strtolower($params['relate_to']);
827
-    if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
828
-        $params['relate_to'] = 'category';
829
-    }
825
+	// Validate relate_to - only category or tags
826
+	$params['relate_to'] = geodir_strtolower($params['relate_to']);
827
+	if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
828
+		$params['relate_to'] = 'category';
829
+	}
830 830
 
831
-    // Validate layout selection
832
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
831
+	// Validate layout selection
832
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
833 833
 
834
-    // Validate sorting option
835
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
834
+	// Validate sorting option
835
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
836 836
 
837
-    // Validate add_location_filter
838
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
837
+	// Validate add_location_filter
838
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
839 839
 
840
-    // Validate listing_width
841
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
840
+	// Validate listing_width
841
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
842 842
 
843
-    // Validate character_count
844
-    $params['character_count'] = absint($params['character_count']);
845
-    if (20 > $params['character_count']) {
846
-        $params['character_count'] = 20;
847
-    }
843
+	// Validate character_count
844
+	$params['character_count'] = absint($params['character_count']);
845
+	if (20 > $params['character_count']) {
846
+		$params['character_count'] = 20;
847
+	}
848 848
 
849
-    if ($related_display = geodir_related_posts_display($params)) {
850
-        echo $related_display;
851
-    }
852
-    $output = ob_get_contents();
849
+	if ($related_display = geodir_related_posts_display($params)) {
850
+		echo $related_display;
851
+	}
852
+	$output = ob_get_contents();
853 853
 
854
-    ob_end_clean();
854
+	ob_end_clean();
855 855
 
856
-    return $output;
856
+	return $output;
857 857
 }
858 858
 
859 859
 /**
@@ -877,12 +877,12 @@  discard block
 block discarded – undo
877 877
  * @return string Advanced search widget HTML.
878 878
  */
879 879
 function geodir_sc_advanced_search($atts) {
880
-    $defaults = array(
880
+	$defaults = array(
881 881
 		'title' => '',
882 882
 		'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advance_search_widget">',
883
-        'after_widget' => '</section>',
884
-        'before_title' => '<h3 class="widget-title">',
885
-        'after_title' => '</h3>',
883
+		'after_widget' => '</section>',
884
+		'before_title' => '<h3 class="widget-title">',
885
+		'after_title' => '</h3>',
886 886
 		'show_adv_search' => 'default'
887 887
 	);
888 888
 	
@@ -906,9 +906,9 @@  discard block
 block discarded – undo
906 906
 	the_widget('geodir_advance_search_widget', $params, $params );
907 907
 	
908 908
 	$output = ob_get_contents();
909
-    ob_end_clean();
909
+	ob_end_clean();
910 910
 
911
-    return $output;
911
+	return $output;
912 912
 }
913 913
 add_shortcode('gd_advanced_search', 'geodir_sc_advanced_search');
914 914
 
@@ -954,48 +954,48 @@  discard block
 block discarded – undo
954 954
 		'add_location_filter' => '1',
955 955
 		'tab_layout' => 'bestof-tabs-on-top',
956 956
 		'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">',
957
-        'after_widget' => '</section>',
958
-        'before_title' => '<h3 class="widget-title">',
959
-        'after_title' => '</h3>',
957
+		'after_widget' => '</section>',
958
+		'before_title' => '<h3 class="widget-title">',
959
+		'after_title' => '</h3>',
960 960
 	);
961 961
 	$params = shortcode_atts($defaults, $atts);
962 962
 
963
-    /**
964
-     * Validate our incoming params
965
-     */
963
+	/**
964
+	 * Validate our incoming params
965
+	 */
966 966
 
967
-    // Validate the selected post type, default to gd_place on fail
968
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
969
-        $params['post_type'] = 'gd_place';
970
-    }
967
+	// Validate the selected post type, default to gd_place on fail
968
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
969
+		$params['post_type'] = 'gd_place';
970
+	}
971 971
 	
972 972
 	// Post limit needs to be a positive integer
973
-    $params['post_limit'] = absint($params['post_limit']);
974
-    if (0 == $params['post_limit']) {
975
-        $params['post_limit'] = 5;
976
-    }
973
+	$params['post_limit'] = absint($params['post_limit']);
974
+	if (0 == $params['post_limit']) {
975
+		$params['post_limit'] = 5;
976
+	}
977 977
 	
978 978
 	// Category limit needs to be a positive integer
979
-    $params['categ_limit'] = absint($params['categ_limit']);
980
-    if (0 == $params['categ_limit']) {
981
-        $params['categ_limit'] = 3;
982
-    }
979
+	$params['categ_limit'] = absint($params['categ_limit']);
980
+	if (0 == $params['categ_limit']) {
981
+		$params['categ_limit'] = 3;
982
+	}
983 983
 	
984 984
 	// Tab layout validation
985
-    $params['tab_layout'] = $params['tab_layout'];
986
-    if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
987
-        $params['tab_layout'] = 'bestof-tabs-on-top';
988
-    }
985
+	$params['tab_layout'] = $params['tab_layout'];
986
+	if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
987
+		$params['tab_layout'] = 'bestof-tabs-on-top';
988
+	}
989 989
 	
990 990
 	// Validate character_count
991
-    $params['character_count'] = $params['character_count'];
991
+	$params['character_count'] = $params['character_count'];
992 992
 
993 993
 	ob_start();
994 994
 	the_widget('geodir_bestof_widget', $params, $params);
995
-    $output = ob_get_contents();
996
-    ob_end_clean();
995
+	$output = ob_get_contents();
996
+	ob_end_clean();
997 997
 
998
-    return $output;
998
+	return $output;
999 999
 }
1000 1000
 add_shortcode('gd_bestof_widget', 'geodir_sc_bestof_widget');
1001 1001
 
@@ -1043,127 +1043,127 @@  discard block
 block discarded – undo
1043 1043
  * @return string HTML content to display geodirectory listings.
1044 1044
  */
1045 1045
 function geodir_sc_gd_listings($atts, $content = '') {
1046
-    global $post;
1047
-    $defaults = array(
1048
-        'title'                 => '',
1049
-        'post_type'             => 'gd_place',
1050
-        'category'              => 0,
1051
-        'list_sort'             => 'latest',
1052
-        'event_type'            => '',
1053
-        'post_number'           => 10,
1054
-        'post_author'           => '',
1055
-        'layout'                => 'gridview_onehalf',
1056
-        'listing_width'         => '',
1057
-        'character_count'       => 20,
1058
-        'add_location_filter'   => 1,
1059
-        'show_featured_only'    => '',
1060
-        'show_special_only'     => '',
1061
-        'with_pics_only'        => '',
1062
-        'with_videos_only'      => '',
1063
-        'with_pagination'       => '1',
1064
-        'top_pagination'        => '0',
1065
-        'bottom_pagination'     => '1',
1066
-        'without_no_results'    => 0,
1067
-        'tags'                  => ''
1068
-    );
1069
-    $params = shortcode_atts($defaults, $atts);
1070
-
1071
-    $params['title']        = wp_strip_all_tags($params['title']);
1072
-    $params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1073
-
1074
-    // Validate the selected category/ies - Grab the current list based on post_type
1075
-    $category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1076
-    $categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1077
-
1078
-    // Make sure we have an array
1079
-    if (!(is_array($params['category']))) {
1080
-        $params['category'] = explode(',', $params['category']);
1081
-    }
1082
-
1083
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
1084
-    // Otherwise it becomes empty and later on that will mean "All"
1085
-    $params['category']     = array_intersect($params['category'], $categories);
1086
-
1087
-    // Post_number needs to be a positive integer
1088
-    $params['post_number']  = absint($params['post_number']);
1089
-    $params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1046
+	global $post;
1047
+	$defaults = array(
1048
+		'title'                 => '',
1049
+		'post_type'             => 'gd_place',
1050
+		'category'              => 0,
1051
+		'list_sort'             => 'latest',
1052
+		'event_type'            => '',
1053
+		'post_number'           => 10,
1054
+		'post_author'           => '',
1055
+		'layout'                => 'gridview_onehalf',
1056
+		'listing_width'         => '',
1057
+		'character_count'       => 20,
1058
+		'add_location_filter'   => 1,
1059
+		'show_featured_only'    => '',
1060
+		'show_special_only'     => '',
1061
+		'with_pics_only'        => '',
1062
+		'with_videos_only'      => '',
1063
+		'with_pagination'       => '1',
1064
+		'top_pagination'        => '0',
1065
+		'bottom_pagination'     => '1',
1066
+		'without_no_results'    => 0,
1067
+		'tags'                  => ''
1068
+	);
1069
+	$params = shortcode_atts($defaults, $atts);
1070
+
1071
+	$params['title']        = wp_strip_all_tags($params['title']);
1072
+	$params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1073
+
1074
+	// Validate the selected category/ies - Grab the current list based on post_type
1075
+	$category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1076
+	$categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1077
+
1078
+	// Make sure we have an array
1079
+	if (!(is_array($params['category']))) {
1080
+		$params['category'] = explode(',', $params['category']);
1081
+	}
1082
+
1083
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
1084
+	// Otherwise it becomes empty and later on that will mean "All"
1085
+	$params['category']     = array_intersect($params['category'], $categories);
1086
+
1087
+	// Post_number needs to be a positive integer
1088
+	$params['post_number']  = absint($params['post_number']);
1089
+	$params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1090 1090
     
1091
-    // Post_number needs to be a positive integer
1092
-    if (!empty($atts['post_author'])) {
1093
-        if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1094
-            $params['post_author'] = $post->post_author;
1095
-        } else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1096
-            $params['post_author'] = absint($atts['post_author']);
1097
-        } else {
1098
-            unset($params['post_author']);
1099
-        }
1100
-    } else {
1101
-        unset($params['post_author']);
1102
-    }
1103
-
1104
-    // Validate character_count
1105
-    //todo: is this necessary?
1106
-    $params['character_count']  = $params['character_count'];
1107
-
1108
-    // Validate our layout choice
1109
-    // Outside of the norm, I added some more simple terms to match the existing
1110
-    // So now I just run the switch to set it properly.
1111
-    $params['layout']           = gdsc_validate_layout_choice($params['layout']);
1112
-
1113
-    // Validate our sorting choice
1114
-    $params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1115
-
1116
-    // Validate Listing width, used in the template widget-listing-listview.php
1117
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1119
-
1120
-    // Validate the checkboxes used on the widget
1121
-    $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1122
-    $params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1123
-    $params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1124
-    $params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1125
-    $params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1126
-    $params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1127
-    $params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1128
-    $params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1129
-
1130
-    // Clean tags
1131
-    if (!empty($params['tags'])) {
1132
-        if (!is_array($params['tags'])) {
1133
-            $comma = _x(',', 'tag delimiter');
1134
-            if ( ',' !== $comma ) {
1135
-                $params['tags'] = str_replace($comma, ',', $params['tags']);
1136
-            }
1137
-            $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1138
-            $params['tags'] = array_map('trim', $params['tags']);
1139
-        }
1140
-    } else {
1141
-        $params['tags'] = array();
1142
-    }
1143
-
1144
-    /**
1145
-     * End of validation
1146
-     */
1147
-    if (isset($atts['geodir_ajax'])) {
1148
-        $params['geodir_ajax'] = $atts['geodir_ajax'];
1149
-        unset($atts['geodir_ajax']);
1150
-    }
1151
-    if (isset($atts['pageno'])) {
1152
-        $params['pageno'] = $atts['pageno'];
1153
-        unset($atts['pageno']);
1154
-    }
1155
-
1156
-    if ( !empty($atts['shortcode_content']) ) {
1157
-        $content = $atts['shortcode_content'];
1158
-    }
1159
-    $params['shortcode_content'] = trim($content);
1160
-    $atts['shortcode_content'] = trim($content);
1091
+	// Post_number needs to be a positive integer
1092
+	if (!empty($atts['post_author'])) {
1093
+		if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1094
+			$params['post_author'] = $post->post_author;
1095
+		} else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1096
+			$params['post_author'] = absint($atts['post_author']);
1097
+		} else {
1098
+			unset($params['post_author']);
1099
+		}
1100
+	} else {
1101
+		unset($params['post_author']);
1102
+	}
1103
+
1104
+	// Validate character_count
1105
+	//todo: is this necessary?
1106
+	$params['character_count']  = $params['character_count'];
1107
+
1108
+	// Validate our layout choice
1109
+	// Outside of the norm, I added some more simple terms to match the existing
1110
+	// So now I just run the switch to set it properly.
1111
+	$params['layout']           = gdsc_validate_layout_choice($params['layout']);
1112
+
1113
+	// Validate our sorting choice
1114
+	$params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1115
+
1116
+	// Validate Listing width, used in the template widget-listing-listview.php
1117
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
+	$params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1119
+
1120
+	// Validate the checkboxes used on the widget
1121
+	$params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1122
+	$params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1123
+	$params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1124
+	$params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1125
+	$params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1126
+	$params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1127
+	$params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1128
+	$params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1129
+
1130
+	// Clean tags
1131
+	if (!empty($params['tags'])) {
1132
+		if (!is_array($params['tags'])) {
1133
+			$comma = _x(',', 'tag delimiter');
1134
+			if ( ',' !== $comma ) {
1135
+				$params['tags'] = str_replace($comma, ',', $params['tags']);
1136
+			}
1137
+			$params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1138
+			$params['tags'] = array_map('trim', $params['tags']);
1139
+		}
1140
+	} else {
1141
+		$params['tags'] = array();
1142
+	}
1143
+
1144
+	/**
1145
+	 * End of validation
1146
+	 */
1147
+	if (isset($atts['geodir_ajax'])) {
1148
+		$params['geodir_ajax'] = $atts['geodir_ajax'];
1149
+		unset($atts['geodir_ajax']);
1150
+	}
1151
+	if (isset($atts['pageno'])) {
1152
+		$params['pageno'] = $atts['pageno'];
1153
+		unset($atts['pageno']);
1154
+	}
1155
+
1156
+	if ( !empty($atts['shortcode_content']) ) {
1157
+		$content = $atts['shortcode_content'];
1158
+	}
1159
+	$params['shortcode_content'] = trim($content);
1160
+	$atts['shortcode_content'] = trim($content);
1161 1161
     
1162
-    $params['shortcode_atts']       = $atts;
1162
+	$params['shortcode_atts']       = $atts;
1163 1163
 
1164
-    $output = geodir_sc_gd_listings_output($params);
1164
+	$output = geodir_sc_gd_listings_output($params);
1165 1165
 
1166
-    return $output;
1166
+	return $output;
1167 1167
 }
1168 1168
 add_shortcode('gd_listings', 'geodir_sc_gd_listings');
1169 1169
 
@@ -1211,23 +1211,23 @@  discard block
 block discarded – undo
1211 1211
 		'max_count' => 'all',
1212 1212
 		'max_level' => '1',
1213 1213
 		'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1214
-        'after_widget' => '</section>',
1215
-        'before_title' => '<h3 class="widget-title">',
1216
-        'after_title' => '</h3>',
1214
+		'after_widget' => '</section>',
1215
+		'before_title' => '<h3 class="widget-title">',
1216
+		'after_title' => '</h3>',
1217 1217
 	);
1218 1218
 	$params = shortcode_atts($defaults, $atts);
1219 1219
 
1220
-    /**
1221
-     * Validate our incoming params
1222
-     */
1220
+	/**
1221
+	 * Validate our incoming params
1222
+	 */
1223 1223
 	// Make sure we have an array
1224
-    $params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1224
+	$params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1225 1225
 	 
1226 1226
 	// Validate the checkboxes used on the widget
1227
-    $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1228
-    $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1229
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1230
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1227
+	$params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1228
+	$params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1229
+	$params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1230
+	$params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1231 1231
 	
1232 1232
 	if ($params['max_count'] != 'all') {
1233 1233
 		$params['max_count'] = absint($params['max_count']);
@@ -1241,10 +1241,10 @@  discard block
 block discarded – undo
1241 1241
 
1242 1242
 	ob_start();
1243 1243
 	the_widget('geodir_cpt_categories_widget', $params, $params);
1244
-    $output = ob_get_contents();
1245
-    ob_end_clean();
1244
+	$output = ob_get_contents();
1245
+	ob_end_clean();
1246 1246
 
1247
-    return $output;
1247
+	return $output;
1248 1248
 }
1249 1249
 add_shortcode('gd_cpt_categories', 'geodir_sc_cpt_categories_widget');
1250 1250
 ?>
1251 1251
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204 204
         $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
205
+        if (get_option('geodir_marker_cluster_type')) {
206 206
             if ($map_args['autozoom']) {
207 207
                 $map_args['enable_marker_cluster_no_reposition'] = false;
208 208
             } else {
209 209
                 $map_args['enable_marker_cluster_no_reposition'] = true;
210 210
             }
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+            $map_args['enable_marker_cluster_server'] = true;
213 213
 
214 214
         }
215 215
 	} else {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
     // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
220
+    if (!empty($params['latitude']) && !empty($params['longitude'])) {
221 221
         $map_args['enable_marker_cluster_no_reposition'] = true;
222 222
     }
223 223
 
@@ -890,20 +890,20 @@  discard block
 block discarded – undo
890 890
 	
891 891
 	$show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : '';
892 892
 	
893
-	if ($show_adv_search != '' ) {
894
-		$show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' ';
893
+	if ($show_adv_search != '') {
894
+		$show_adv_class = 'geodir-advance-search-'.$show_adv_search.' ';
895 895
 		if ($show_adv_search == 'searched' && geodir_is_page('search')) {
896 896
 			$show_adv_search = 'search';
897 897
 		}
898
-		$show_adv_attrs = 'data-show-adv="' . $show_adv_search . '"';
898
+		$show_adv_attrs = 'data-show-adv="'.$show_adv_search.'"';
899 899
 		
900
-		$params['before_widget'] = str_replace('class="', $show_adv_attrs . ' class="' . $show_adv_class, $params['before_widget']);
900
+		$params['before_widget'] = str_replace('class="', $show_adv_attrs.' class="'.$show_adv_class, $params['before_widget']);
901 901
 	}
902 902
 	
903 903
 	ob_start();
904 904
 	
905 905
 	//geodir_get_template_part('listing', 'filter-form');
906
-	the_widget('geodir_advance_search_widget', $params, $params );
906
+	the_widget('geodir_advance_search_widget', $params, $params);
907 907
 	
908 908
 	$output = ob_get_contents();
909 909
     ob_end_clean();
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
     // Validate character_count
1105 1105
     //todo: is this necessary?
1106
-    $params['character_count']  = $params['character_count'];
1106
+    $params['character_count'] = $params['character_count'];
1107 1107
 
1108 1108
     // Validate our layout choice
1109 1109
     // Outside of the norm, I added some more simple terms to match the existing
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
     // Validate Listing width, used in the template widget-listing-listview.php
1117 1117
     // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1118
+    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1119 1119
 
1120 1120
     // Validate the checkboxes used on the widget
1121 1121
     $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
     if (!empty($params['tags'])) {
1132 1132
         if (!is_array($params['tags'])) {
1133 1133
             $comma = _x(',', 'tag delimiter');
1134
-            if ( ',' !== $comma ) {
1134
+            if (',' !== $comma) {
1135 1135
                 $params['tags'] = str_replace($comma, ',', $params['tags']);
1136 1136
             }
1137 1137
             $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
@@ -1153,13 +1153,13 @@  discard block
 block discarded – undo
1153 1153
         unset($atts['pageno']);
1154 1154
     }
1155 1155
 
1156
-    if ( !empty($atts['shortcode_content']) ) {
1156
+    if (!empty($atts['shortcode_content'])) {
1157 1157
         $content = $atts['shortcode_content'];
1158 1158
     }
1159 1159
     $params['shortcode_content'] = trim($content);
1160 1160
     $atts['shortcode_content'] = trim($content);
1161 1161
     
1162
-    $params['shortcode_atts']       = $atts;
1162
+    $params['shortcode_atts'] = $atts;
1163 1163
 
1164 1164
     $output = geodir_sc_gd_listings_output($params);
1165 1165
 
@@ -1226,8 +1226,8 @@  discard block
 block discarded – undo
1226 1226
 	// Validate the checkboxes used on the widget
1227 1227
     $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1228 1228
     $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1229
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1230
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1229
+    $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']);
1230
+    $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']);
1231 1231
 	
1232 1232
 	if ($params['max_count'] != 'all') {
1233 1233
 		$params['max_count'] = absint($params['max_count']);
Please login to merge, or discard this patch.