@@ -61,11 +61,12 @@ discard block |
||
61 | 61 | function geodir_is_default_location_set() |
62 | 62 | { |
63 | 63 | $default_location = geodir_get_default_location(); |
64 | - if (!empty($default_location)) |
|
65 | - return true; |
|
66 | - else |
|
67 | - return false; |
|
68 | -} |
|
64 | + if (!empty($default_location)) { |
|
65 | + return true; |
|
66 | + } else { |
|
67 | + return false; |
|
68 | + } |
|
69 | + } |
|
69 | 70 | |
70 | 71 | /** |
71 | 72 | * Returns location slug using location string. |
@@ -258,8 +259,9 @@ discard block |
||
258 | 259 | |
259 | 260 | } |
260 | 261 | |
261 | - if ($geodir_location->is_default) |
|
262 | - update_option('geodir_default_location', $geodir_location); |
|
262 | + if ($geodir_location->is_default) { |
|
263 | + update_option('geodir_default_location', $geodir_location); |
|
264 | + } |
|
263 | 265 | |
264 | 266 | return $geodir_location->location_id; |
265 | 267 | |
@@ -307,9 +309,10 @@ discard block |
||
307 | 309 | $status = $data->status; |
308 | 310 | if ($status == "OK") { |
309 | 311 | return $data->results[0]->address_components; |
310 | - } else |
|
311 | - return false; |
|
312 | -} |
|
312 | + } else { |
|
313 | + return false; |
|
314 | + } |
|
315 | + } |
|
313 | 316 | |
314 | 317 | /** |
315 | 318 | * Returns current location terms. |
@@ -333,16 +336,19 @@ discard block |
||
333 | 336 | } |
334 | 337 | |
335 | 338 | $country = $gd_session->get('gd_country'); |
336 | - if ($country != '' && $country) |
|
337 | - $location_array['gd_country'] = urldecode($country); |
|
339 | + if ($country != '' && $country) { |
|
340 | + $location_array['gd_country'] = urldecode($country); |
|
341 | + } |
|
338 | 342 | |
339 | 343 | $region = $gd_session->get('gd_region'); |
340 | - if ($region != '' && $region) |
|
341 | - $location_array['gd_region'] = urldecode($region); |
|
344 | + if ($region != '' && $region) { |
|
345 | + $location_array['gd_region'] = urldecode($region); |
|
346 | + } |
|
342 | 347 | |
343 | 348 | $city = $gd_session->get('gd_city'); |
344 | - if ($city != '' && $city) |
|
345 | - $location_array['gd_city'] = urldecode($city); |
|
349 | + if ($city != '' && $city) { |
|
350 | + $location_array['gd_city'] = urldecode($city); |
|
351 | + } |
|
346 | 352 | } else { |
347 | 353 | if ((isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] == 'me') || (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] == 'me') || (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] == 'me')) { |
348 | 354 | return $location_array; |
@@ -354,14 +360,17 @@ discard block |
||
354 | 360 | |
355 | 361 | $city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
356 | 362 | |
357 | - if ($country != '') |
|
358 | - $location_array['gd_country'] = urldecode($country); |
|
363 | + if ($country != '') { |
|
364 | + $location_array['gd_country'] = urldecode($country); |
|
365 | + } |
|
359 | 366 | |
360 | - if ($region != '') |
|
361 | - $location_array['gd_region'] = urldecode($region); |
|
367 | + if ($region != '') { |
|
368 | + $location_array['gd_region'] = urldecode($region); |
|
369 | + } |
|
362 | 370 | |
363 | - if ($city != '') |
|
364 | - $location_array['gd_city'] = urldecode($city); |
|
371 | + if ($city != '') { |
|
372 | + $location_array['gd_city'] = urldecode($city); |
|
373 | + } |
|
365 | 374 | |
366 | 375 | // Fix category link in ajax popular category widget on change post type |
367 | 376 | if (empty($location_array) && defined('DOING_AJAX') && DOING_AJAX) { |