Test Failed
Pull Request — master (#299)
by Kiran
19:35
created
geodirectory-functions/location_functions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 {
125 125
     global $wpdb;
126 126
 
127
-    $rows = $wpdb->get_results("SELECT Country,ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " ORDER BY Country ASC");
127
+    $rows = $wpdb->get_results("SELECT Country,ISO2 FROM ".GEODIR_COUNTRIES_TABLE." ORDER BY Country ASC");
128 128
     
129 129
     $ISO2 = array();
130 130
     $countries = array();
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
     
137 137
     asort($countries);
138 138
     
139
-    $out_put = '<option ' . selected('', $post_country, false) . ' value="">' . __('Select Country', 'geodirectory') . '</option>';
139
+    $out_put = '<option '.selected('', $post_country, false).' value="">'.__('Select Country', 'geodirectory').'</option>';
140 140
     foreach ($countries as $country => $name) {
141 141
         $ccode = $ISO2[$country];
142 142
 
143
-        $out_put .= '<option ' . selected($post_country, $country, false) . ' value="' . esc_attr($country) . '" data-country_code="' . $ccode . '">' . $name . '</option>';
143
+        $out_put .= '<option '.selected($post_country, $country, false).' value="'.esc_attr($country).'" data-country_code="'.$ccode.'">'.$name.'</option>';
144 144
     }
145 145
 
146 146
     echo $out_put;
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
         if (isset($_REQUEST['listing_action']) && $_REQUEST['listing_action'] == 'delete') {
183 183
 
184 184
             foreach ($posttype as $posttypeobj) {
185
-                $post_locations = '[' . $default_location->city_slug . '],[' . $default_location->region_slug . '],[' . $default_location->country_slug . ']'; // set all overall post location
185
+                $post_locations = '['.$default_location->city_slug.'],['.$default_location->region_slug.'],['.$default_location->country_slug.']'; // set all overall post location
186 186
 
187 187
                 $sql = $wpdb->prepare(
188
-                    "UPDATE " . $plugin_prefix . $posttypeobj . "_detail SET post_city=%s, post_region=%s, post_country=%s, post_locations=%s WHERE post_location_id=%d AND ( post_city!=%s OR post_region!=%s OR post_country!=%s OR post_locations!=%s OR post_locations IS NULL)",
188
+                    "UPDATE ".$plugin_prefix.$posttypeobj."_detail SET post_city=%s, post_region=%s, post_country=%s, post_locations=%s WHERE post_location_id=%d AND ( post_city!=%s OR post_region!=%s OR post_country!=%s OR post_locations!=%s OR post_locations IS NULL)",
189 189
                     array($_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations, $locationid, $_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations)
190 190
                 );
191 191
                 $wpdb->query($sql);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
          *
234 234
          * @since 1.0.0
235 235
          */
236
-        $geodir_location = (object)apply_filters('geodir_add_new_location', array('location_id' => 0,
236
+        $geodir_location = (object) apply_filters('geodir_add_new_location', array('location_id' => 0,
237 237
             'country' => $location_country,
238 238
             'region' => $location_region,
239 239
             'city' => $location_city,
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
  */
296 296
 function geodir_get_address_by_lat_lan($lat, $lng)
297 297
 {
298
-    $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . trim($lat) . ',' . trim($lng) ;
298
+    $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='.trim($lat).','.trim($lng);
299 299
 
300 300
     $ch = curl_init();
301 301
     curl_setopt($ch, CURLOPT_URL, $url);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	 * @param string $location_array_from Source type of location terms. Default session.
389 389
 	 * @param string $gd_post_type WP post type.
390 390
 	 */
391
-	$location_array = apply_filters( 'geodir_current_location_terms', $location_array, $location_array_from, $gd_post_type );
391
+	$location_array = apply_filters('geodir_current_location_terms', $location_array, $location_array_from, $gd_post_type);
392 392
 
393 393
     return $location_array;
394 394
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
  */
435 435
 function geodir_get_osm_address_by_lat_lan($lat, $lng) {
436 436
     $url = is_ssl() ? 'https:' : 'http:';
437
-    $url .= '//nominatim.openstreetmap.org/reverse?format=json&lat=' . trim($lat) . '&lon=' . trim($lng) . '&zoom=16&addressdetails=1&email=' . get_option('admin_email');
437
+    $url .= '//nominatim.openstreetmap.org/reverse?format=json&lat='.trim($lat).'&lon='.trim($lng).'&zoom=16&addressdetails=1&email='.get_option('admin_email');
438 438
 
439 439
     $ch = curl_init();
440 440
     curl_setopt($ch, CURLOPT_URL, $url);
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
     
449 449
     if (!empty($data) && !empty($data->address)) {
450 450
         $address_fields = array('public_building', 'house', 'house_number', 'bakery', 'footway', 'street', 'road', 'village', 'attraction', 'pedestrian', 'neighbourhood', 'suburb');
451
-        $formatted_address = (array)$data->address;
451
+        $formatted_address = (array) $data->address;
452 452
         
453
-        foreach ( $data->address as $key => $value ) {
453
+        foreach ($data->address as $key => $value) {
454 454
             if (!in_array($key, $address_fields)) {
455 455
                 unset($formatted_address[$key]);
456 456
             }
Please login to merge, or discard this patch.