@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | */ |
10 | 10 | function geodir_get_current_city_lat() |
11 | 11 | { |
12 | - $location = geodir_get_default_location(); |
|
13 | - $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : '39.952484'; |
|
12 | + $location = geodir_get_default_location(); |
|
13 | + $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : '39.952484'; |
|
14 | 14 | |
15 | - return $lat; |
|
15 | + return $lat; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function geodir_get_current_city_lng() |
27 | 27 | { |
28 | - $location = geodir_get_default_location(); |
|
29 | - $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : '-75.163786'; |
|
30 | - return $lng; |
|
28 | + $location = geodir_get_default_location(); |
|
29 | + $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : '-75.163786'; |
|
30 | + return $lng; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function geodir_get_default_location() |
42 | 42 | { |
43 | - /** |
|
44 | - * Filter the default location. |
|
45 | - * |
|
46 | - * @since 1.0.0 |
|
47 | - * @package GeoDirectory |
|
48 | - * |
|
49 | - * @param string $location_result The default location object. |
|
50 | - */ |
|
51 | - return $location_result = apply_filters('geodir_get_default_location', get_option('geodir_default_location')); |
|
43 | + /** |
|
44 | + * Filter the default location. |
|
45 | + * |
|
46 | + * @since 1.0.0 |
|
47 | + * @package GeoDirectory |
|
48 | + * |
|
49 | + * @param string $location_result The default location object. |
|
50 | + */ |
|
51 | + return $location_result = apply_filters('geodir_get_default_location', get_option('geodir_default_location')); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | */ |
61 | 61 | function geodir_is_default_location_set() |
62 | 62 | { |
63 | - $default_location = geodir_get_default_location(); |
|
64 | - if (!empty($default_location)) |
|
65 | - return true; |
|
66 | - else |
|
67 | - return false; |
|
63 | + $default_location = geodir_get_default_location(); |
|
64 | + if (!empty($default_location)) |
|
65 | + return true; |
|
66 | + else |
|
67 | + return false; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | function create_location_slug($location_string) |
79 | 79 | { |
80 | 80 | |
81 | - /** |
|
82 | - * Filter the location slug. |
|
83 | - * |
|
84 | - * @since 1.0.0 |
|
85 | - * @package GeoDirectory |
|
86 | - * |
|
87 | - * @param string $location_string Sanitized location string. |
|
88 | - */ |
|
89 | - return urldecode(apply_filters('geodir_location_slug_check', sanitize_title($location_string))); |
|
81 | + /** |
|
82 | + * Filter the location slug. |
|
83 | + * |
|
84 | + * @since 1.0.0 |
|
85 | + * @package GeoDirectory |
|
86 | + * |
|
87 | + * @param string $location_string Sanitized location string. |
|
88 | + */ |
|
89 | + return urldecode(apply_filters('geodir_location_slug_check', sanitize_title($location_string))); |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | */ |
101 | 101 | function geodir_get_location($id = '') |
102 | 102 | { |
103 | - /** |
|
104 | - * Filter the location information. |
|
105 | - * |
|
106 | - * @since 1.0.0 |
|
107 | - * @package GeoDirectory |
|
108 | - * |
|
109 | - * @param string $id The location ID. |
|
110 | - */ |
|
111 | - return $location_result = apply_filters('geodir_get_location_by_id', get_option('geodir_default_location'), $id); |
|
103 | + /** |
|
104 | + * Filter the location information. |
|
105 | + * |
|
106 | + * @since 1.0.0 |
|
107 | + * @package GeoDirectory |
|
108 | + * |
|
109 | + * @param string $id The location ID. |
|
110 | + */ |
|
111 | + return $location_result = apply_filters('geodir_get_location_by_id', get_option('geodir_default_location'), $id); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -122,28 +122,28 @@ discard block |
||
122 | 122 | */ |
123 | 123 | function geodir_get_country_dl($post_country = '', $prefix = '') |
124 | 124 | { |
125 | - global $wpdb; |
|
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 | - $ISO2 = array(); |
|
130 | - $countries = array(); |
|
129 | + $ISO2 = array(); |
|
130 | + $countries = array(); |
|
131 | 131 | |
132 | - foreach ($rows as $row) { |
|
133 | - $ISO2[$row->Country] = $row->ISO2; |
|
134 | - $countries[$row->Country] = __($row->Country, 'geodirectory'); |
|
135 | - } |
|
132 | + foreach ($rows as $row) { |
|
133 | + $ISO2[$row->Country] = $row->ISO2; |
|
134 | + $countries[$row->Country] = __($row->Country, 'geodirectory'); |
|
135 | + } |
|
136 | 136 | |
137 | - asort($countries); |
|
137 | + asort($countries); |
|
138 | 138 | |
139 | - $out_put = '<option ' . selected('', $post_country, false) . ' value="">' . __('Select Country', 'geodirectory') . '</option>'; |
|
140 | - foreach ($countries as $country => $name) { |
|
141 | - $ccode = $ISO2[$country]; |
|
139 | + $out_put = '<option ' . selected('', $post_country, false) . ' value="">' . __('Select Country', 'geodirectory') . '</option>'; |
|
140 | + foreach ($countries as $country => $name) { |
|
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>'; |
|
144 | - } |
|
143 | + $out_put .= '<option ' . selected($post_country, $country, false) . ' value="' . esc_attr($country) . '" data-country_code="' . $ccode . '">' . $name . '</option>'; |
|
144 | + } |
|
145 | 145 | |
146 | - echo $out_put; |
|
146 | + echo $out_put; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | |
@@ -158,40 +158,40 @@ discard block |
||
158 | 158 | function geodir_location_form_submit() |
159 | 159 | { |
160 | 160 | |
161 | - global $wpdb, $plugin_prefix; |
|
162 | - if (isset($_REQUEST['add_location'])) { |
|
161 | + global $wpdb, $plugin_prefix; |
|
162 | + if (isset($_REQUEST['add_location'])) { |
|
163 | 163 | |
164 | - $location_info = array( |
|
165 | - 'city' => $_REQUEST['city'], |
|
166 | - 'region' => $_REQUEST['region'], |
|
167 | - 'country' => $_REQUEST['country'], |
|
168 | - 'geo_lat' => $_REQUEST['latitude'], |
|
169 | - 'geo_lng' => $_REQUEST['longitude'], |
|
170 | - 'is_default' => $_REQUEST['is_default'], |
|
171 | - 'update_city' => $_REQUEST['update_city'] |
|
172 | - ); |
|
164 | + $location_info = array( |
|
165 | + 'city' => $_REQUEST['city'], |
|
166 | + 'region' => $_REQUEST['region'], |
|
167 | + 'country' => $_REQUEST['country'], |
|
168 | + 'geo_lat' => $_REQUEST['latitude'], |
|
169 | + 'geo_lng' => $_REQUEST['longitude'], |
|
170 | + 'is_default' => $_REQUEST['is_default'], |
|
171 | + 'update_city' => $_REQUEST['update_city'] |
|
172 | + ); |
|
173 | 173 | |
174 | - $old_location = geodir_get_default_location(); |
|
174 | + $old_location = geodir_get_default_location(); |
|
175 | 175 | |
176 | - $locationid = geodir_add_new_location($location_info); |
|
176 | + $locationid = geodir_add_new_location($location_info); |
|
177 | 177 | |
178 | - $default_location = geodir_get_location($locationid); |
|
178 | + $default_location = geodir_get_location($locationid); |
|
179 | 179 | |
180 | - //UPDATE AND DELETE LISTING |
|
181 | - $posttype = geodir_get_posttypes(); |
|
182 | - if (isset($_REQUEST['listing_action']) && $_REQUEST['listing_action'] == 'delete') { |
|
180 | + //UPDATE AND DELETE LISTING |
|
181 | + $posttype = geodir_get_posttypes(); |
|
182 | + if (isset($_REQUEST['listing_action']) && $_REQUEST['listing_action'] == 'delete') { |
|
183 | 183 | |
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 |
|
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 |
|
186 | 186 | |
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)", |
|
189 | - array($_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations, $locationid, $_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations) |
|
190 | - ); |
|
191 | - $wpdb->query($sql); |
|
192 | - } |
|
193 | - } |
|
194 | - } |
|
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)", |
|
189 | + array($_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations, $locationid, $_REQUEST['city'], $_REQUEST['region'], $_REQUEST['country'], $post_locations) |
|
190 | + ); |
|
191 | + $wpdb->query($sql); |
|
192 | + } |
|
193 | + } |
|
194 | + } |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -215,37 +215,37 @@ discard block |
||
215 | 215 | */ |
216 | 216 | function geodir_add_new_location($location_info = array()) |
217 | 217 | { |
218 | - global $wpdb; |
|
219 | - |
|
220 | - if (!empty($location_info)) { |
|
221 | - $location_city = ($location_info['city'] != '') ? $location_info['city'] : 'all'; |
|
222 | - $location_region = ($location_info['region'] != '') ? $location_info['region'] : 'all'; |
|
223 | - $location_country = ($location_info['country'] != '') ? geodir_get_normal_country($location_info['country']) : 'all'; |
|
224 | - $location_lat = ($location_info['geo_lat'] != '') ? $location_info['geo_lat'] : ''; |
|
225 | - $location_lng = ($location_info['geo_lng'] != '') ? $location_info['geo_lng'] : ''; |
|
226 | - $is_default = isset($location_info['is_default']) ? $location_info['is_default'] : ''; |
|
227 | - $country_slug = create_location_slug(__($location_country, 'geodirectory')); |
|
228 | - $region_slug = create_location_slug($location_region); |
|
229 | - $city_slug = create_location_slug($location_city); |
|
218 | + global $wpdb; |
|
219 | + |
|
220 | + if (!empty($location_info)) { |
|
221 | + $location_city = ($location_info['city'] != '') ? $location_info['city'] : 'all'; |
|
222 | + $location_region = ($location_info['region'] != '') ? $location_info['region'] : 'all'; |
|
223 | + $location_country = ($location_info['country'] != '') ? geodir_get_normal_country($location_info['country']) : 'all'; |
|
224 | + $location_lat = ($location_info['geo_lat'] != '') ? $location_info['geo_lat'] : ''; |
|
225 | + $location_lng = ($location_info['geo_lng'] != '') ? $location_info['geo_lng'] : ''; |
|
226 | + $is_default = isset($location_info['is_default']) ? $location_info['is_default'] : ''; |
|
227 | + $country_slug = create_location_slug(__($location_country, 'geodirectory')); |
|
228 | + $region_slug = create_location_slug($location_region); |
|
229 | + $city_slug = create_location_slug($location_city); |
|
230 | 230 | |
231 | - /** |
|
232 | - * Filter add new location data. |
|
233 | - * |
|
234 | - * @since 1.0.0 |
|
235 | - */ |
|
236 | - $geodir_location = (object)apply_filters('geodir_add_new_location', array('location_id' => 0, |
|
237 | - 'country' => $location_country, |
|
238 | - 'region' => $location_region, |
|
239 | - 'city' => $location_city, |
|
240 | - 'country_slug' => $country_slug, |
|
241 | - 'region_slug' => $region_slug, |
|
242 | - 'city_slug' => $city_slug, |
|
243 | - 'city_latitude' => $location_lat, |
|
244 | - 'city_longitude' => $location_lng, |
|
245 | - 'is_default' => $is_default |
|
246 | - )); |
|
247 | - |
|
248 | - /* // Not allowed to create country in DB : 2016-12-09 |
|
231 | + /** |
|
232 | + * Filter add new location data. |
|
233 | + * |
|
234 | + * @since 1.0.0 |
|
235 | + */ |
|
236 | + $geodir_location = (object)apply_filters('geodir_add_new_location', array('location_id' => 0, |
|
237 | + 'country' => $location_country, |
|
238 | + 'region' => $location_region, |
|
239 | + 'city' => $location_city, |
|
240 | + 'country_slug' => $country_slug, |
|
241 | + 'region_slug' => $region_slug, |
|
242 | + 'city_slug' => $city_slug, |
|
243 | + 'city_latitude' => $location_lat, |
|
244 | + 'city_longitude' => $location_lng, |
|
245 | + 'is_default' => $is_default |
|
246 | + )); |
|
247 | + |
|
248 | + /* // Not allowed to create country in DB : 2016-12-09 |
|
249 | 249 | if ($geodir_location->country) { |
250 | 250 | |
251 | 251 | $get_country = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s", array($geodir_location->country))); |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | } |
260 | 260 | */ |
261 | 261 | |
262 | - if ($geodir_location->is_default) |
|
263 | - update_option('geodir_default_location', $geodir_location); |
|
262 | + if ($geodir_location->is_default) |
|
263 | + update_option('geodir_default_location', $geodir_location); |
|
264 | 264 | |
265 | - return $geodir_location->location_id; |
|
265 | + return $geodir_location->location_id; |
|
266 | 266 | |
267 | - } else { |
|
268 | - return false; |
|
269 | - } |
|
267 | + } else { |
|
268 | + return false; |
|
269 | + } |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | function geodir_random_float($min = 0, $max = 1) |
282 | 282 | { |
283 | - return $min + mt_rand() / mt_getrandmax() * ($max - $min); |
|
283 | + return $min + mt_rand() / mt_getrandmax() * ($max - $min); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
@@ -294,22 +294,22 @@ discard block |
||
294 | 294 | */ |
295 | 295 | function geodir_get_address_by_lat_lan($lat, $lng) |
296 | 296 | { |
297 | - $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . trim($lat) . ',' . trim($lng) ; |
|
298 | - |
|
299 | - $ch = curl_init(); |
|
300 | - curl_setopt($ch, CURLOPT_URL, $url); |
|
301 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
302 | - curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
303 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
304 | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
305 | - $response = curl_exec($ch); |
|
306 | - curl_close($ch); |
|
307 | - $data = json_decode($response); |
|
308 | - $status = $data->status; |
|
309 | - if ($status == "OK") { |
|
310 | - return $data->results[0]->address_components; |
|
311 | - } else |
|
312 | - return false; |
|
297 | + $url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . trim($lat) . ',' . trim($lng) ; |
|
298 | + |
|
299 | + $ch = curl_init(); |
|
300 | + curl_setopt($ch, CURLOPT_URL, $url); |
|
301 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
302 | + curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
303 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
304 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
305 | + $response = curl_exec($ch); |
|
306 | + curl_close($ch); |
|
307 | + $data = json_decode($response); |
|
308 | + $status = $data->status; |
|
309 | + if ($status == "OK") { |
|
310 | + return $data->results[0]->address_components; |
|
311 | + } else |
|
312 | + return false; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -326,70 +326,70 @@ discard block |
||
326 | 326 | */ |
327 | 327 | function geodir_get_current_location_terms($location_array_from = 'session', $gd_post_type = '') |
328 | 328 | { |
329 | - global $wp, $gd_session; |
|
330 | - $location_array = array(); |
|
331 | - if ($location_array_from == 'session') { |
|
332 | - if ($gd_session->get('gd_country') == 'me' || $gd_session->get('gd_region') == 'me' || $gd_session->get('gd_city') == 'me') { |
|
333 | - return $location_array; |
|
334 | - } |
|
329 | + global $wp, $gd_session; |
|
330 | + $location_array = array(); |
|
331 | + if ($location_array_from == 'session') { |
|
332 | + if ($gd_session->get('gd_country') == 'me' || $gd_session->get('gd_region') == 'me' || $gd_session->get('gd_city') == 'me') { |
|
333 | + return $location_array; |
|
334 | + } |
|
335 | 335 | |
336 | - $country = $gd_session->get('gd_country'); |
|
337 | - if ($country != '' && $country) |
|
338 | - $location_array['gd_country'] = urldecode($country); |
|
336 | + $country = $gd_session->get('gd_country'); |
|
337 | + if ($country != '' && $country) |
|
338 | + $location_array['gd_country'] = urldecode($country); |
|
339 | 339 | |
340 | - $region = $gd_session->get('gd_region'); |
|
341 | - if ($region != '' && $region) |
|
342 | - $location_array['gd_region'] = urldecode($region); |
|
340 | + $region = $gd_session->get('gd_region'); |
|
341 | + if ($region != '' && $region) |
|
342 | + $location_array['gd_region'] = urldecode($region); |
|
343 | 343 | |
344 | - $city = $gd_session->get('gd_city'); |
|
345 | - if ($city != '' && $city) |
|
346 | - $location_array['gd_city'] = urldecode($city); |
|
347 | - } else { |
|
348 | - 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')) { |
|
349 | - return $location_array; |
|
350 | - } |
|
344 | + $city = $gd_session->get('gd_city'); |
|
345 | + if ($city != '' && $city) |
|
346 | + $location_array['gd_city'] = urldecode($city); |
|
347 | + } else { |
|
348 | + 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')) { |
|
349 | + return $location_array; |
|
350 | + } |
|
351 | 351 | |
352 | - $country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
352 | + $country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
353 | 353 | |
354 | - $region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
354 | + $region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
355 | 355 | |
356 | - $city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
356 | + $city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
357 | 357 | |
358 | - if ($country != '') |
|
359 | - $location_array['gd_country'] = urldecode($country); |
|
358 | + if ($country != '') |
|
359 | + $location_array['gd_country'] = urldecode($country); |
|
360 | 360 | |
361 | - if ($region != '') |
|
362 | - $location_array['gd_region'] = urldecode($region); |
|
361 | + if ($region != '') |
|
362 | + $location_array['gd_region'] = urldecode($region); |
|
363 | 363 | |
364 | - if ($city != '') |
|
365 | - $location_array['gd_city'] = urldecode($city); |
|
364 | + if ($city != '') |
|
365 | + $location_array['gd_city'] = urldecode($city); |
|
366 | 366 | |
367 | 367 | // Fix category link in ajax popular category widget on change post type |
368 | 368 | if (empty($location_array) && defined('DOING_AJAX') && DOING_AJAX) { |
369 | 369 | $location_array = geodir_get_current_location_terms('session'); |
370 | 370 | } |
371 | - } |
|
371 | + } |
|
372 | 372 | |
373 | 373 | /** |
374 | 374 | * Filter the location terms. |
375 | 375 | * |
376 | 376 | * @since 1.4.6 |
377 | - * @package GeoDirectory |
|
377 | + * @package GeoDirectory |
|
378 | + * |
|
379 | + * @param array $location_array { |
|
380 | + * Attributes of the location_array. |
|
381 | + * |
|
382 | + * @type string $gd_country The country slug. |
|
383 | + * @type string $gd_region The region slug. |
|
384 | + * @type string $gd_city The city slug. |
|
378 | 385 | * |
379 | - * @param array $location_array { |
|
380 | - * Attributes of the location_array. |
|
381 | - * |
|
382 | - * @type string $gd_country The country slug. |
|
383 | - * @type string $gd_region The region slug. |
|
384 | - * @type string $gd_city The city slug. |
|
385 | - * |
|
386 | - * } |
|
386 | + * } |
|
387 | 387 | * @param string $location_array_from Source type of location terms. Default session. |
388 | 388 | * @param string $gd_post_type WP post type. |
389 | 389 | */ |
390 | 390 | $location_array = apply_filters( 'geodir_current_location_terms', $location_array, $location_array_from, $gd_post_type ); |
391 | 391 | |
392 | - return $location_array; |
|
392 | + return $location_array; |
|
393 | 393 | |
394 | 394 | } |
395 | 395 | |
@@ -402,24 +402,24 @@ discard block |
||
402 | 402 | * @return bool|string |
403 | 403 | */ |
404 | 404 | function geodir_get_location_link($which_location = 'current') { |
405 | - $location_link = get_permalink(geodir_location_page_id()); |
|
406 | - |
|
407 | - if ($which_location == 'base') { |
|
408 | - return $location_link; |
|
409 | - } else { |
|
410 | - $location_terms = geodir_get_current_location_terms(); |
|
411 | - |
|
412 | - if (!empty($location_terms)) { |
|
413 | - if (get_option('permalink_structure') != '') { |
|
414 | - $location_terms = implode("/", $location_terms); |
|
415 | - $location_terms = rtrim($location_terms, '/'); |
|
416 | - $location_link .= $location_terms; |
|
417 | - } else { |
|
418 | - $location_link = geodir_getlink($location_link, $location_terms); |
|
419 | - } |
|
420 | - } |
|
421 | - } |
|
422 | - return $location_link; |
|
405 | + $location_link = get_permalink(geodir_location_page_id()); |
|
406 | + |
|
407 | + if ($which_location == 'base') { |
|
408 | + return $location_link; |
|
409 | + } else { |
|
410 | + $location_terms = geodir_get_current_location_terms(); |
|
411 | + |
|
412 | + if (!empty($location_terms)) { |
|
413 | + if (get_option('permalink_structure') != '') { |
|
414 | + $location_terms = implode("/", $location_terms); |
|
415 | + $location_terms = rtrim($location_terms, '/'); |
|
416 | + $location_link .= $location_terms; |
|
417 | + } else { |
|
418 | + $location_link = geodir_getlink($location_link, $location_terms); |
|
419 | + } |
|
420 | + } |
|
421 | + } |
|
422 | + return $location_link; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
@@ -432,34 +432,34 @@ discard block |
||
432 | 432 | * @return array|bool Returns address on success. |
433 | 433 | */ |
434 | 434 | function geodir_get_osm_address_by_lat_lan($lat, $lng) { |
435 | - $url = is_ssl() ? 'https:' : 'http:'; |
|
436 | - $url .= '//nominatim.openstreetmap.org/reverse?format=json&lat=' . trim($lat) . '&lon=' . trim($lng) . '&zoom=16&addressdetails=1&email=' . get_option('admin_email'); |
|
437 | - |
|
438 | - $ch = curl_init(); |
|
439 | - curl_setopt($ch, CURLOPT_URL, $url); |
|
440 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
441 | - curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
442 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
443 | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
444 | - $response = curl_exec($ch); |
|
445 | - curl_close($ch); |
|
446 | - $data = json_decode($response); |
|
435 | + $url = is_ssl() ? 'https:' : 'http:'; |
|
436 | + $url .= '//nominatim.openstreetmap.org/reverse?format=json&lat=' . trim($lat) . '&lon=' . trim($lng) . '&zoom=16&addressdetails=1&email=' . get_option('admin_email'); |
|
437 | + |
|
438 | + $ch = curl_init(); |
|
439 | + curl_setopt($ch, CURLOPT_URL, $url); |
|
440 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
441 | + curl_setopt($ch, CURLOPT_PROXYPORT, 3128); |
|
442 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
443 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
|
444 | + $response = curl_exec($ch); |
|
445 | + curl_close($ch); |
|
446 | + $data = json_decode($response); |
|
447 | 447 | |
448 | - if (!empty($data) && !empty($data->address)) { |
|
449 | - $address_fields = array('public_building', 'house', 'house_number', 'bakery', 'footway', 'street', 'road', 'village', 'attraction', 'pedestrian', 'neighbourhood', 'suburb'); |
|
450 | - $formatted_address = (array)$data->address; |
|
448 | + if (!empty($data) && !empty($data->address)) { |
|
449 | + $address_fields = array('public_building', 'house', 'house_number', 'bakery', 'footway', 'street', 'road', 'village', 'attraction', 'pedestrian', 'neighbourhood', 'suburb'); |
|
450 | + $formatted_address = (array)$data->address; |
|
451 | 451 | |
452 | - foreach ( $data->address as $key => $value ) { |
|
453 | - if (!in_array($key, $address_fields)) { |
|
454 | - unset($formatted_address[$key]); |
|
455 | - } |
|
456 | - } |
|
457 | - $data->formatted_address = !empty($formatted_address) ? implode(', ', $formatted_address) : ''; |
|
452 | + foreach ( $data->address as $key => $value ) { |
|
453 | + if (!in_array($key, $address_fields)) { |
|
454 | + unset($formatted_address[$key]); |
|
455 | + } |
|
456 | + } |
|
457 | + $data->formatted_address = !empty($formatted_address) ? implode(', ', $formatted_address) : ''; |
|
458 | 458 | |
459 | - return $data; |
|
460 | - } else { |
|
461 | - return false; |
|
462 | - } |
|
459 | + return $data; |
|
460 | + } else { |
|
461 | + return false; |
|
462 | + } |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -471,47 +471,47 @@ discard block |
||
471 | 471 | * @return string Returns the country. |
472 | 472 | */ |
473 | 473 | function geodir_get_normal_country($country) { |
474 | - global $wpdb; |
|
475 | - if ($result = geodir_get_country_by_name($country)) { |
|
476 | - return $result; |
|
477 | - } |
|
474 | + global $wpdb; |
|
475 | + if ($result = geodir_get_country_by_name($country)) { |
|
476 | + return $result; |
|
477 | + } |
|
478 | 478 | |
479 | - if (defined('POST_LOCATION_TABLE')) { |
|
480 | - $rows = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country NOT LIKE %s ORDER BY location_id ASC", $country)); |
|
481 | - if (!empty($rows)) { |
|
482 | - foreach ($rows as $row) { |
|
483 | - $translated = __($row->country, 'geodirectory'); |
|
484 | - if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
485 | - return $result; |
|
486 | - } |
|
487 | - } |
|
488 | - } |
|
479 | + if (defined('POST_LOCATION_TABLE')) { |
|
480 | + $rows = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country NOT LIKE %s ORDER BY location_id ASC", $country)); |
|
481 | + if (!empty($rows)) { |
|
482 | + foreach ($rows as $row) { |
|
483 | + $translated = __($row->country, 'geodirectory'); |
|
484 | + if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
485 | + return $result; |
|
486 | + } |
|
487 | + } |
|
488 | + } |
|
489 | 489 | |
490 | - $rows = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country_slug LIKE %s AND country NOT LIKE %s ORDER BY location_id", $country, $country ) ); |
|
491 | - if (!empty($rows)) { |
|
492 | - foreach ($rows as $row) { |
|
493 | - $translated = __($row->country, 'geodirectory'); |
|
494 | - if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
495 | - return $result; |
|
496 | - } |
|
497 | - } |
|
498 | - } |
|
499 | - } |
|
490 | + $rows = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT country FROM " . POST_LOCATION_TABLE . " WHERE country_slug LIKE %s AND country NOT LIKE %s ORDER BY location_id", $country, $country ) ); |
|
491 | + if (!empty($rows)) { |
|
492 | + foreach ($rows as $row) { |
|
493 | + $translated = __($row->country, 'geodirectory'); |
|
494 | + if (geodir_strtolower($translated) == geodir_strtolower($country) && $result = geodir_get_country_by_name($row->country)) { |
|
495 | + return $result; |
|
496 | + } |
|
497 | + } |
|
498 | + } |
|
499 | + } |
|
500 | 500 | |
501 | - $default_location = geodir_get_default_location(); |
|
502 | - if (!empty($default_location->country) && $result = geodir_get_country_by_name($default_location->country)) { |
|
503 | - return $result; |
|
504 | - } |
|
501 | + $default_location = geodir_get_default_location(); |
|
502 | + if (!empty($default_location->country) && $result = geodir_get_country_by_name($default_location->country)) { |
|
503 | + return $result; |
|
504 | + } |
|
505 | 505 | |
506 | - if (!empty($default_location->country_slug) && $result = geodir_get_country_by_name($default_location->country_slug)) { |
|
507 | - return $result; |
|
508 | - } |
|
506 | + if (!empty($default_location->country_slug) && $result = geodir_get_country_by_name($default_location->country_slug)) { |
|
507 | + return $result; |
|
508 | + } |
|
509 | 509 | |
510 | - if (!empty($default_location->country_ISO2) && $result = geodir_get_country_by_name($default_location->country_ISO2, true)) { |
|
511 | - return $result; |
|
512 | - } |
|
510 | + if (!empty($default_location->country_ISO2) && $result = geodir_get_country_by_name($default_location->country_ISO2, true)) { |
|
511 | + return $result; |
|
512 | + } |
|
513 | 513 | |
514 | - return $country; |
|
514 | + return $country; |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | /** |
@@ -523,16 +523,16 @@ discard block |
||
523 | 523 | * @return string Country ISO2 code. |
524 | 524 | */ |
525 | 525 | function geodir_get_country_iso2($country) { |
526 | - global $wpdb; |
|
526 | + global $wpdb; |
|
527 | 527 | |
528 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
529 | - return $result; |
|
530 | - } |
|
531 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", geodir_get_normal_country($country)))) { |
|
532 | - return $result; |
|
533 | - } |
|
528 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
529 | + return $result; |
|
530 | + } |
|
531 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", geodir_get_normal_country($country)))) { |
|
532 | + return $result; |
|
533 | + } |
|
534 | 534 | |
535 | - return $country; |
|
535 | + return $country; |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | /** |
@@ -545,16 +545,16 @@ discard block |
||
545 | 545 | * @return string|null Country ISO2 code. |
546 | 546 | */ |
547 | 547 | function geodir_get_country_by_name($country, $iso2 = false) { |
548 | - global $wpdb; |
|
548 | + global $wpdb; |
|
549 | 549 | |
550 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
551 | - return $result; |
|
552 | - } |
|
553 | - if ($iso2 && $result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE ISO2 LIKE %s", $country))) { |
|
554 | - return $result; |
|
555 | - } |
|
550 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country))) { |
|
551 | + return $result; |
|
552 | + } |
|
553 | + if ($iso2 && $result = $wpdb->get_var($wpdb->prepare("SELECT Country FROM " . GEODIR_COUNTRIES_TABLE . " WHERE ISO2 LIKE %s", $country))) { |
|
554 | + return $result; |
|
555 | + } |
|
556 | 556 | |
557 | - return NULL; |
|
557 | + return NULL; |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | |
@@ -573,125 +573,125 @@ discard block |
||
573 | 573 | * @return string Filtered content. |
574 | 574 | */ |
575 | 575 | function geodir_replace_location_variables($content, $location_array = array(), $sep = NULL, $gd_page = '') { |
576 | - global $wp; |
|
576 | + global $wp; |
|
577 | 577 | |
578 | - if (empty($content)) { |
|
579 | - return $content; |
|
580 | - } |
|
578 | + if (empty($content)) { |
|
579 | + return $content; |
|
580 | + } |
|
581 | 581 | |
582 | - $location_manager = defined('GEODIRLOCATION_VERSION') ? true : false; |
|
582 | + $location_manager = defined('GEODIRLOCATION_VERSION') ? true : false; |
|
583 | 583 | |
584 | - if (empty($location_array)) { |
|
585 | - $location_array = geodir_get_current_location_terms('query_vars'); |
|
586 | - } |
|
584 | + if (empty($location_array)) { |
|
585 | + $location_array = geodir_get_current_location_terms('query_vars'); |
|
586 | + } |
|
587 | 587 | |
588 | - $location_terms = array(); |
|
589 | - $location_terms['gd_neighbourhood'] = !empty($wp->query_vars['gd_neighbourhood']) ? $wp->query_vars['gd_neighbourhood'] : ''; |
|
590 | - $location_terms['gd_city'] = !empty($wp->query_vars['gd_city']) ? $wp->query_vars['gd_city'] : ''; |
|
591 | - $location_terms['gd_region'] = !empty($wp->query_vars['gd_region']) ? $wp->query_vars['gd_region'] : ''; |
|
592 | - $location_terms['gd_country'] = !empty($wp->query_vars['gd_country']) ? $wp->query_vars['gd_country'] : ''; |
|
593 | - |
|
594 | - $location_names = array(); |
|
595 | - foreach ($location_terms as $type => $location) { |
|
596 | - $location_name = $location; |
|
588 | + $location_terms = array(); |
|
589 | + $location_terms['gd_neighbourhood'] = !empty($wp->query_vars['gd_neighbourhood']) ? $wp->query_vars['gd_neighbourhood'] : ''; |
|
590 | + $location_terms['gd_city'] = !empty($wp->query_vars['gd_city']) ? $wp->query_vars['gd_city'] : ''; |
|
591 | + $location_terms['gd_region'] = !empty($wp->query_vars['gd_region']) ? $wp->query_vars['gd_region'] : ''; |
|
592 | + $location_terms['gd_country'] = !empty($wp->query_vars['gd_country']) ? $wp->query_vars['gd_country'] : ''; |
|
593 | + |
|
594 | + $location_names = array(); |
|
595 | + foreach ($location_terms as $type => $location) { |
|
596 | + $location_name = $location; |
|
597 | 597 | |
598 | - if (!empty($location_name)) { |
|
599 | - if ($location_manager) { |
|
600 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
601 | - $location_name = get_actual_location_name($location_type, $location, true); |
|
602 | - } else { |
|
603 | - $location_name = preg_replace( '/-(\d+)$/', '', $location_name); |
|
604 | - $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
605 | - $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
606 | - } |
|
607 | - } |
|
598 | + if (!empty($location_name)) { |
|
599 | + if ($location_manager) { |
|
600 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
601 | + $location_name = get_actual_location_name($location_type, $location, true); |
|
602 | + } else { |
|
603 | + $location_name = preg_replace( '/-(\d+)$/', '', $location_name); |
|
604 | + $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
605 | + $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
606 | + } |
|
607 | + } |
|
608 | 608 | |
609 | - $location_names[$type] = $location_name; |
|
610 | - } |
|
609 | + $location_names[$type] = $location_name; |
|
610 | + } |
|
611 | 611 | |
612 | - $location_single = ''; |
|
613 | - foreach ($location_terms as $type => $location) { |
|
614 | - if (!empty($location)) { |
|
615 | - if (!empty($location_names[$type])) { |
|
616 | - $location_single = $location_names[$type]; |
|
617 | - } else { |
|
618 | - if ($location_manager) { |
|
619 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
620 | - $location_single = get_actual_location_name($location_type, $location, true); |
|
621 | - } else { |
|
622 | - $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
623 | - $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
624 | - $location_single = __(geodir_ucwords($location_name), 'geodirectory'); |
|
625 | - } |
|
626 | - } |
|
627 | - break; |
|
628 | - } |
|
629 | - } |
|
612 | + $location_single = ''; |
|
613 | + foreach ($location_terms as $type => $location) { |
|
614 | + if (!empty($location)) { |
|
615 | + if (!empty($location_names[$type])) { |
|
616 | + $location_single = $location_names[$type]; |
|
617 | + } else { |
|
618 | + if ($location_manager) { |
|
619 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
620 | + $location_single = get_actual_location_name($location_type, $location, true); |
|
621 | + } else { |
|
622 | + $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
623 | + $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
624 | + $location_single = __(geodir_ucwords($location_name), 'geodirectory'); |
|
625 | + } |
|
626 | + } |
|
627 | + break; |
|
628 | + } |
|
629 | + } |
|
630 | 630 | |
631 | - $full_location = array(); |
|
632 | - if (!empty($location_array)) { |
|
633 | - $location_array = array_reverse($location_array); |
|
634 | - |
|
635 | - foreach ($location_array as $type => $location) { |
|
636 | - if (!empty($location_names[$type])) { |
|
637 | - $location_name = $location_names[$type]; |
|
638 | - } else { |
|
639 | - if ($location_manager) { |
|
640 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
641 | - $location_name = get_actual_location_name($location_type, $location, true); |
|
642 | - } else { |
|
643 | - $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
644 | - $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
645 | - $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
646 | - } |
|
647 | - } |
|
648 | - |
|
649 | - $full_location[] = $location_name; |
|
650 | - } |
|
631 | + $full_location = array(); |
|
632 | + if (!empty($location_array)) { |
|
633 | + $location_array = array_reverse($location_array); |
|
634 | + |
|
635 | + foreach ($location_array as $type => $location) { |
|
636 | + if (!empty($location_names[$type])) { |
|
637 | + $location_name = $location_names[$type]; |
|
638 | + } else { |
|
639 | + if ($location_manager) { |
|
640 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
641 | + $location_name = get_actual_location_name($location_type, $location, true); |
|
642 | + } else { |
|
643 | + $location_name = preg_replace( '/-(\d+)$/', '', $location); |
|
644 | + $location_name = preg_replace( '/[_-]/', ' ', $location_name ); |
|
645 | + $location_name = __(geodir_ucwords($location_name), 'geodirectory'); |
|
646 | + } |
|
647 | + } |
|
648 | + |
|
649 | + $full_location[] = $location_name; |
|
650 | + } |
|
651 | 651 | |
652 | - if (!empty($full_location)) { |
|
653 | - $full_location = array_unique($full_location); |
|
654 | - } |
|
655 | - } |
|
656 | - $full_location = !empty($full_location) ? implode(', ', $full_location): ''; |
|
652 | + if (!empty($full_location)) { |
|
653 | + $full_location = array_unique($full_location); |
|
654 | + } |
|
655 | + } |
|
656 | + $full_location = !empty($full_location) ? implode(', ', $full_location): ''; |
|
657 | 657 | |
658 | - $location_replace_vars = array(); |
|
659 | - $location_replace_vars['%%location_sep%%'] = $sep !== NULL ? $sep : '|'; |
|
660 | - $location_replace_vars['%%location%%'] = $full_location; |
|
661 | - $location_replace_vars['%%in_location%%'] = $full_location != '' ? __( 'in', 'geodirectory' ) . ' ' . $full_location : ''; |
|
662 | - $location_replace_vars['%%location_single%%'] = $location_single; |
|
663 | - $location_replace_vars['%%in_location_single%%'] = $location_single != '' ? __( 'in', 'geodirectory' ) . ' ' . $location_single : ''; |
|
658 | + $location_replace_vars = array(); |
|
659 | + $location_replace_vars['%%location_sep%%'] = $sep !== NULL ? $sep : '|'; |
|
660 | + $location_replace_vars['%%location%%'] = $full_location; |
|
661 | + $location_replace_vars['%%in_location%%'] = $full_location != '' ? __( 'in', 'geodirectory' ) . ' ' . $full_location : ''; |
|
662 | + $location_replace_vars['%%location_single%%'] = $location_single; |
|
663 | + $location_replace_vars['%%in_location_single%%'] = $location_single != '' ? __( 'in', 'geodirectory' ) . ' ' . $location_single : ''; |
|
664 | 664 | |
665 | - foreach ($location_names as $type => $name) { |
|
666 | - $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
665 | + foreach ($location_names as $type => $name) { |
|
666 | + $location_type = strpos($type, 'gd_') === 0 ? substr($type, 3) : $type; |
|
667 | 667 | |
668 | - $location_replace_vars['%%location_' . $location_type . '%%'] = $name; |
|
669 | - $location_replace_vars['%%in_location_' . $location_type . '%%'] = !empty($name) ? __( 'in', 'geodirectory' ) . ' ' . $name : ''; |
|
670 | - } |
|
671 | - |
|
672 | - /** |
|
673 | - * Filter the location terms variables to search & replace. |
|
674 | - * |
|
675 | - * @since 1.6.16 |
|
676 | - * @package GeoDirectory |
|
677 | - * |
|
678 | - * @param array $location_replace_vars The array of search & replace variables. |
|
679 | - * @param string $content The content with variables. |
|
680 | - * @param array $location_array The array of location variables. |
|
681 | - * @param string $gd_page The page being filtered. |
|
682 | - * @param string $sep The separator. |
|
683 | - */ |
|
684 | - $location_replace_vars = apply_filters( 'geodir_filter_location_replace_variables', $location_replace_vars, $content, $location_array, $gd_page, $sep ); |
|
685 | - |
|
686 | - if (!empty($location_replace_vars)) { |
|
687 | - foreach ($location_replace_vars as $search => $replace) { |
|
688 | - if (!empty($search) && strpos($content, $search) !== false) { |
|
689 | - $content = str_replace($search, $replace, $content); |
|
690 | - } |
|
691 | - } |
|
692 | - } |
|
668 | + $location_replace_vars['%%location_' . $location_type . '%%'] = $name; |
|
669 | + $location_replace_vars['%%in_location_' . $location_type . '%%'] = !empty($name) ? __( 'in', 'geodirectory' ) . ' ' . $name : ''; |
|
670 | + } |
|
671 | + |
|
672 | + /** |
|
673 | + * Filter the location terms variables to search & replace. |
|
674 | + * |
|
675 | + * @since 1.6.16 |
|
676 | + * @package GeoDirectory |
|
677 | + * |
|
678 | + * @param array $location_replace_vars The array of search & replace variables. |
|
679 | + * @param string $content The content with variables. |
|
680 | + * @param array $location_array The array of location variables. |
|
681 | + * @param string $gd_page The page being filtered. |
|
682 | + * @param string $sep The separator. |
|
683 | + */ |
|
684 | + $location_replace_vars = apply_filters( 'geodir_filter_location_replace_variables', $location_replace_vars, $content, $location_array, $gd_page, $sep ); |
|
685 | + |
|
686 | + if (!empty($location_replace_vars)) { |
|
687 | + foreach ($location_replace_vars as $search => $replace) { |
|
688 | + if (!empty($search) && strpos($content, $search) !== false) { |
|
689 | + $content = str_replace($search, $replace, $content); |
|
690 | + } |
|
691 | + } |
|
692 | + } |
|
693 | 693 | |
694 | - return $content; |
|
694 | + return $content; |
|
695 | 695 | } |
696 | 696 | add_filter('geodir_replace_location_variables', 'geodir_replace_location_variables'); |
697 | 697 | add_filter('geodir_replace_location_variables_seo', 'geodir_replace_location_variables'); |
698 | 698 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | $gd_wpseo_use = ''; |
12 | 12 | if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) { |
13 | - $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />"; |
|
13 | + $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />"; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | /** |
@@ -21,360 +21,360 @@ discard block |
||
21 | 21 | */ |
22 | 22 | $geodir_settings['title_meta_settings'] = apply_filters('geodir_title_meta_settings', array( |
23 | 23 | |
24 | - /* Listing Permalink Settings start */ |
|
25 | - array('name' => __('Title / Meta', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set page title and meta', 'id' => 'geodir_title_meta_settings '), |
|
26 | - |
|
27 | - array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'), |
|
28 | - 'desc' => '%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%location_country%%, %%in_location_country%%, %%location_region%%, %%in_location_region%%, %%location_city%%, %%in_location_city%%, %%location_sep%%, %%search_term%%, %%search_near%%, %%name%%, %%page%%, %%pagenumber%%, %%pagetotal%%', |
|
29 | - 'type' => 'sectionstart', |
|
30 | - 'id' => 'geodir_meta_vars'), |
|
31 | - |
|
32 | - array('type' => 'sectionend', 'id' => 'geodir_meta_vars'), |
|
33 | - |
|
34 | - array('name' => __('Homepage Meta Settings', 'geodirectory'), |
|
35 | - 'type' => 'sectionstart', |
|
36 | - 'desc' => '', |
|
37 | - 'id' => 'geodir_home_meta'), |
|
38 | - |
|
39 | - array( |
|
40 | - 'name' => __('Homepage meta title', 'geodirectory'), |
|
41 | - 'desc' => __('This will use the title of the page set as frontpage if left blank.', 'geodirectory'), |
|
42 | - 'id' => 'geodir_meta_title_homepage', |
|
43 | - 'type' => 'text', |
|
44 | - 'css' => 'width:100%;', |
|
45 | - 'std' => '', |
|
46 | - 'placeholder' => '' |
|
47 | - ), |
|
48 | - |
|
49 | - array( |
|
50 | - 'name' => __('Homepage meta description', 'geodirectory'), |
|
51 | - 'desc' => __('Enter the meta description for the homepage.', 'geodirectory'), |
|
52 | - 'id' => 'geodir_meta_desc_homepage', |
|
53 | - 'type' => 'textarea', |
|
54 | - 'css' => 'width:100%;', |
|
55 | - 'std' => '' |
|
56 | - ), |
|
57 | - |
|
58 | - array('type' => 'sectionend', 'id' => 'geodir_home_meta'), |
|
59 | - |
|
60 | - // details page meta |
|
61 | - array('name' => __('Details Page Meta Settings', 'geodirectory'), |
|
62 | - 'type' => 'sectionstart', |
|
63 | - 'desc' => '', |
|
64 | - 'id' => 'geodir_details_meta'), |
|
65 | - |
|
66 | - array( |
|
67 | - 'name' => __('Details page meta title', 'geodirectory'), |
|
68 | - 'desc' => __('Enter the meta title for the details page.', 'geodirectory'), |
|
69 | - 'id' => 'geodir_meta_title_detail', |
|
70 | - 'type' => 'text', |
|
71 | - 'css' => 'width:100%;', |
|
72 | - 'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'), |
|
73 | - 'placeholder' => '%%title%% %%sep%% %%sitename%%' |
|
74 | - ), |
|
75 | - |
|
76 | - array( |
|
77 | - 'name' => __('Details page meta description', 'geodirectory'), |
|
78 | - 'desc' => __('Enter the meta description for the details page.', 'geodirectory'), |
|
79 | - 'id' => 'geodir_meta_desc_detail', |
|
80 | - 'type' => 'textarea', |
|
81 | - 'css' => 'width:100%;', |
|
82 | - 'std' => __('%%excerpt%%', 'geodirectory'), |
|
83 | - 'placeholder' => '%%excerpt%%' |
|
84 | - ), |
|
85 | - |
|
86 | - array('type' => 'sectionend', 'id' => 'geodir_details_meta'), |
|
87 | - |
|
88 | - // CPT page meta |
|
89 | - array('name' => __('Post Type Page Meta Settings', 'geodirectory'), |
|
90 | - 'type' => 'sectionstart', |
|
91 | - 'desc' => '', |
|
92 | - 'id' => 'geodir_pt_meta'), |
|
93 | - |
|
94 | - array( |
|
95 | - 'name' => __('Post type page meta title', 'geodirectory'), |
|
96 | - 'desc' => __('Enter the meta title for the post type pages.', 'geodirectory'), |
|
97 | - 'id' => 'geodir_meta_title_pt', |
|
98 | - 'type' => 'text', |
|
99 | - 'css' => 'width:100%;', |
|
100 | - 'std' => __('%%pt_plural%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'), |
|
101 | - 'placeholder' => '%%pt_plural%% %%in_location%% %%sep%% %%sitename%%' |
|
102 | - ), |
|
103 | - |
|
104 | - array( |
|
105 | - 'name' => __('Post type page meta description', 'geodirectory'), |
|
106 | - 'desc' => __('Enter the meta description for the post type pages.', 'geodirectory'), |
|
107 | - 'id' => 'geodir_meta_desc_pt', |
|
108 | - 'type' => 'textarea', |
|
109 | - 'css' => 'width:100%;', |
|
110 | - 'std' => __('%%pt_plural%% %%in_location%%', 'geodirectory'), |
|
111 | - 'placeholder' => '%%pt_plural%% %%in_location%%' |
|
112 | - ), |
|
113 | - |
|
114 | - array( |
|
115 | - 'name' => __('Post type page title', 'geodirectory'), |
|
116 | - 'desc' => __('Enter the title for the post type pages.', 'geodirectory'), |
|
117 | - 'id' => 'geodir_page_title_pt', |
|
118 | - 'type' => 'text', |
|
119 | - 'css' => 'width:100%;', |
|
120 | - 'std' => __('All %%pt_plural%% %%in_location_single%%', 'geodirectory'), |
|
121 | - 'placeholder' => 'All %%pt_plural%% %%in_location_single%%' |
|
122 | - ), |
|
123 | - |
|
124 | - array('type' => 'sectionend', 'id' => 'geodir_pt_meta'), |
|
125 | - |
|
126 | - // Cat listing page meta |
|
127 | - array('name' => __('Listing Page Meta Settings', 'geodirectory'), |
|
128 | - 'type' => 'sectionstart', |
|
129 | - 'desc' => '', |
|
130 | - 'id' => 'geodir_pt_meta'), |
|
131 | - |
|
132 | - array( |
|
133 | - 'name' => __('Listing page meta title', 'geodirectory'), |
|
134 | - 'desc' => __('Enter the meta title for the category listing pages.', 'geodirectory'), |
|
135 | - 'id' => 'geodir_meta_title_listing', |
|
136 | - 'type' => 'text', |
|
137 | - 'css' => 'width:100%;', |
|
138 | - 'std' => __('%%category%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'), |
|
139 | - 'placeholder' => '%%category%% %%in_location%% %%sep%% %%sitename%%' |
|
140 | - ), |
|
141 | - |
|
142 | - array( |
|
143 | - 'name' => __('Listing page meta description', 'geodirectory'), |
|
144 | - 'desc' => __('Enter the meta description for the category listing pages.', 'geodirectory'), |
|
145 | - 'id' => 'geodir_meta_desc_listing', |
|
146 | - 'type' => 'textarea', |
|
147 | - 'css' => 'width:100%;', |
|
148 | - 'std' => __('Posts related to Category: %%category%% %%in_location%%', 'geodirectory'), |
|
149 | - 'placeholder' => 'Posts related to Category: %%category%% %%in_location%%' |
|
150 | - ), |
|
151 | - |
|
152 | - array( |
|
153 | - 'name' => __('Category listing page title', 'geodirectory'), |
|
154 | - 'desc' => __('Enter the title for the category listing pages.', 'geodirectory'), |
|
155 | - 'id' => 'geodir_page_title_cat-listing', |
|
156 | - 'type' => 'text', |
|
157 | - 'css' => 'width:100%;', |
|
158 | - 'std' => __('All %%category%% %%in_location_single%%', 'geodirectory'), |
|
159 | - 'placeholder' => 'All %%category%% %%in_location_single%%' |
|
160 | - ), |
|
161 | - |
|
162 | - array( |
|
163 | - 'name' => __('Tag listing page title', 'geodirectory'), |
|
164 | - 'desc' => __('Enter the title for the tag listing pages.', 'geodirectory'), |
|
165 | - 'id' => 'geodir_page_title_tag-listing', |
|
166 | - 'type' => 'text', |
|
167 | - 'css' => 'width:100%;', |
|
168 | - 'std' => __('Tag: %%tag%% %%in_location_single%%', 'geodirectory'), |
|
169 | - 'placeholder' => 'Tag: %%tag%% %%in_location_single%%' |
|
170 | - ), |
|
171 | - |
|
172 | - array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
173 | - |
|
174 | - // location page meta |
|
175 | - array('name' => __('Location Page Meta Settings', 'geodirectory'), |
|
176 | - 'type' => 'sectionstart', |
|
177 | - 'desc' => '', |
|
178 | - 'id' => 'geodir_pt_meta'), |
|
179 | - |
|
180 | - array( |
|
181 | - 'name' => __('Location page meta title', 'geodirectory'), |
|
182 | - 'desc' => __('Enter the meta title for the location pages.', 'geodirectory'), |
|
183 | - 'id' => 'geodir_meta_title_location', |
|
184 | - 'type' => 'text', |
|
185 | - 'css' => 'width:100%;', |
|
186 | - 'std' => __('%%title%% %%location%% %%sep%% %%sitename%%', 'geodirectory'), |
|
187 | - 'placeholder' => '%%title%% %%location%% %%sep%% %%sitename%%' |
|
188 | - ), |
|
189 | - |
|
190 | - array( |
|
191 | - 'name' => __('Location page meta description', 'geodirectory'), |
|
192 | - 'desc' => __('Enter the meta description for the location pages.', 'geodirectory'), |
|
193 | - 'id' => 'geodir_meta_desc_location', |
|
194 | - 'type' => 'textarea', |
|
195 | - 'css' => 'width:100%;', |
|
196 | - 'std' => __('%%location%%', 'geodirectory'), |
|
197 | - 'placeholder' => '%%location%%' |
|
198 | - ), |
|
199 | - |
|
200 | - array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
201 | - |
|
202 | - // Search page meta |
|
203 | - array('name' => __('Search Page Meta Settings', 'geodirectory'), |
|
204 | - 'type' => 'sectionstart', |
|
205 | - 'desc' => '', |
|
206 | - 'id' => 'geodir_pt_meta'), |
|
207 | - |
|
208 | - array( |
|
209 | - 'name' => __('Search page meta title', 'geodirectory'), |
|
210 | - 'desc' => __('Enter the meta title for the search page.', 'geodirectory'), |
|
211 | - 'id' => 'geodir_meta_title_search', |
|
212 | - 'type' => 'text', |
|
213 | - 'css' => 'width:100%;', |
|
214 | - 'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%', 'geodirectory'), |
|
215 | - 'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%' |
|
216 | - ), |
|
217 | - |
|
218 | - array( |
|
219 | - 'name' => __('Search page meta description', 'geodirectory'), |
|
220 | - 'desc' => __('Enter the meta description for the search page.', 'geodirectory'), |
|
221 | - 'id' => 'geodir_meta_desc_search', |
|
222 | - 'type' => 'textarea', |
|
223 | - 'css' => 'width:100%;', |
|
224 | - 'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%%', 'geodirectory'), |
|
225 | - 'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%%' |
|
226 | - ), |
|
227 | - |
|
228 | - array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
229 | - |
|
230 | - //Add listing page meta |
|
231 | - array('name' => __('Add Listing Page Meta Settings', 'geodirectory'), |
|
232 | - 'type' => 'sectionstart', |
|
233 | - 'desc' => '', |
|
234 | - 'id' => 'geodir_pt_meta'), |
|
235 | - |
|
236 | - array( |
|
237 | - 'name' => __('Add listing page meta title', 'geodirectory'), |
|
238 | - 'desc' => __('Enter the meta title for the add listing page.', 'geodirectory'), |
|
239 | - 'id' => 'geodir_meta_title_add-listing', |
|
240 | - 'type' => 'text', |
|
241 | - 'css' => 'width:100%;', |
|
242 | - 'std' => __('Add %%pt_single%% %%sep%% %%sitename%%', 'geodirectory'), |
|
243 | - 'placeholder' => 'Add %%pt_single%% %%sep%% %%sitename%%' |
|
244 | - ), |
|
245 | - |
|
246 | - array( |
|
247 | - 'name' => __('Add listing page meta description', 'geodirectory'), |
|
248 | - 'desc' => __('Enter the meta description for the add listing page.', 'geodirectory'), |
|
249 | - 'id' => 'geodir_meta_desc_add-listing', |
|
250 | - 'type' => 'textarea', |
|
251 | - 'css' => 'width:100%;', |
|
252 | - 'std' => __('Add %%pt_single%%', 'geodirectory'), |
|
253 | - 'placeholder' => 'Add %%pt_single%%' |
|
254 | - ), |
|
255 | - |
|
256 | - array( |
|
257 | - 'name' => __('Add listing page title', 'geodirectory'), |
|
258 | - 'desc' => __('Enter the title for the add listing page.', 'geodirectory'), |
|
259 | - 'id' => 'geodir_page_title_add-listing', |
|
260 | - 'type' => 'text', |
|
261 | - 'css' => 'width:100%;', |
|
262 | - 'std' => __('Add %%pt_single%%', 'geodirectory'), |
|
263 | - 'placeholder' => 'Add %%pt_single%%' |
|
264 | - ), |
|
265 | - |
|
266 | - array( |
|
267 | - 'name' => __('Edit listing page title', 'geodirectory'), |
|
268 | - 'desc' => __('Enter the title for the edit listing page.', 'geodirectory'), |
|
269 | - 'id' => 'geodir_page_title_edit-listing', |
|
270 | - 'type' => 'text', |
|
271 | - 'css' => 'width:100%;', |
|
272 | - 'std' => __('Edit %%pt_single%%', 'geodirectory'), |
|
273 | - 'placeholder' => 'Edit %%pt_single%%' |
|
274 | - ), |
|
275 | - |
|
276 | - array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
277 | - |
|
278 | - //Author page meta |
|
279 | - array('name' => __('Author Page Meta Settings', 'geodirectory'), |
|
280 | - 'type' => 'sectionstart', |
|
281 | - 'desc' => '', |
|
282 | - 'id' => 'geodir_pt_meta'), |
|
283 | - |
|
284 | - array( |
|
285 | - 'name' => __('Author page meta title', 'geodirectory'), |
|
286 | - 'desc' => __('Enter the meta title for the author page.', 'geodirectory'), |
|
287 | - 'id' => 'geodir_meta_title_author', |
|
288 | - 'type' => 'text', |
|
289 | - 'css' => 'width:100%;', |
|
290 | - 'std' => __('Author: %%name%% %%sep%% %%sitename%%', 'geodirectory'), |
|
291 | - 'placeholder' => 'Author: %%name%% %%sep%% %%sitename%%' |
|
292 | - ), |
|
293 | - |
|
294 | - array( |
|
295 | - 'name' => __('Author page meta description', 'geodirectory'), |
|
296 | - 'desc' => __('Enter the meta description for the author page.', 'geodirectory'), |
|
297 | - 'id' => 'geodir_meta_desc_author', |
|
298 | - 'type' => 'textarea', |
|
299 | - 'css' => 'width:100%;', |
|
300 | - 'std' => '' |
|
301 | - ), |
|
302 | - |
|
303 | - array( |
|
304 | - 'name' => __('Author page title', 'geodirectory'), |
|
305 | - 'desc' => __('Enter the title for the author page.', 'geodirectory'), |
|
306 | - 'id' => 'geodir_page_title_author', |
|
307 | - 'type' => 'text', |
|
308 | - 'css' => 'width:100%;', |
|
309 | - 'std' => __('%%pt_plural%% by: %%name%%', 'geodirectory'), |
|
310 | - 'placeholder' => '%%pt_plural%% by: %%name%%' |
|
311 | - ), |
|
312 | - |
|
313 | - array( |
|
314 | - 'name' => __('Author favorite page title', 'geodirectory'), |
|
315 | - 'desc' => __('Enter the title for the author favorite page.', 'geodirectory'), |
|
316 | - 'id' => 'geodir_page_title_favorite', |
|
317 | - 'type' => 'text', |
|
318 | - 'css' => 'width:100%;', |
|
319 | - 'std' => __('%%name%%: Favorite %%pt_plural%%', 'geodirectory'), |
|
320 | - 'placeholder' => '%%name%%: Favorite %%pt_plural%%' |
|
321 | - ), |
|
322 | - |
|
323 | - array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
324 | - |
|
325 | - //Login page meta |
|
326 | - array('name' => __('Login Page Meta Settings', 'geodirectory'), |
|
327 | - 'type' => 'sectionstart', |
|
328 | - 'desc' => '', |
|
329 | - 'id' => 'geodir_login_meta'), |
|
330 | - |
|
331 | - array( |
|
332 | - 'name' => __('Login page meta title', 'geodirectory'), |
|
333 | - 'desc' => __('Enter the meta title for the login page.', 'geodirectory'), |
|
334 | - 'id' => 'geodir_meta_title_login', |
|
335 | - 'type' => 'text', |
|
336 | - 'css' => 'width:100%;', |
|
337 | - 'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'), |
|
338 | - 'placeholder' => '%%title%% %%sep%% %%sitename%%' |
|
339 | - ), |
|
340 | - |
|
341 | - array( |
|
342 | - 'name' => __('Login page meta description', 'geodirectory'), |
|
343 | - 'desc' => __('Enter the meta description for the login page.', 'geodirectory'), |
|
344 | - 'id' => 'geodir_meta_desc_login', |
|
345 | - 'type' => 'textarea', |
|
346 | - 'css' => 'width:100%;', |
|
347 | - 'std' => '' |
|
348 | - ), |
|
349 | - |
|
350 | - array('type' => 'sectionend', 'id' => 'geodir_login_meta'), |
|
351 | - |
|
352 | - //Listing success page meta |
|
353 | - array('name' => __('Listing Success Page Meta Settings', 'geodirectory'), |
|
354 | - 'type' => 'sectionstart', |
|
355 | - 'desc' => '', |
|
356 | - 'id' => 'geodir_login_meta'), |
|
357 | - |
|
358 | - array( |
|
359 | - 'name' => __('Listing success page meta title', 'geodirectory'), |
|
360 | - 'desc' => __('Enter the meta title for the listing success page.', 'geodirectory'), |
|
361 | - 'id' => 'geodir_meta_title_listing-success', |
|
362 | - 'type' => 'text', |
|
363 | - 'css' => 'width:100%;', |
|
364 | - 'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'), |
|
365 | - 'placeholder' => '%%title%% %%sep%% %%sitename%%' |
|
366 | - ), |
|
367 | - |
|
368 | - array( |
|
369 | - 'name' => __('Listing success page meta description', 'geodirectory'), |
|
370 | - 'desc' => __('Enter the meta description for the listing success page.', 'geodirectory'), |
|
371 | - 'id' => 'geodir_meta_desc_listing-success', |
|
372 | - 'type' => 'textarea', |
|
373 | - 'css' => 'width:100%;', |
|
374 | - 'std' => '' |
|
375 | - ), |
|
376 | - |
|
377 | - array('type' => 'sectionend', 'id' => 'geodir_login_meta'), |
|
24 | + /* Listing Permalink Settings start */ |
|
25 | + array('name' => __('Title / Meta', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set page title and meta', 'id' => 'geodir_title_meta_settings '), |
|
26 | + |
|
27 | + array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'), |
|
28 | + 'desc' => '%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%location_country%%, %%in_location_country%%, %%location_region%%, %%in_location_region%%, %%location_city%%, %%in_location_city%%, %%location_sep%%, %%search_term%%, %%search_near%%, %%name%%, %%page%%, %%pagenumber%%, %%pagetotal%%', |
|
29 | + 'type' => 'sectionstart', |
|
30 | + 'id' => 'geodir_meta_vars'), |
|
31 | + |
|
32 | + array('type' => 'sectionend', 'id' => 'geodir_meta_vars'), |
|
33 | + |
|
34 | + array('name' => __('Homepage Meta Settings', 'geodirectory'), |
|
35 | + 'type' => 'sectionstart', |
|
36 | + 'desc' => '', |
|
37 | + 'id' => 'geodir_home_meta'), |
|
38 | + |
|
39 | + array( |
|
40 | + 'name' => __('Homepage meta title', 'geodirectory'), |
|
41 | + 'desc' => __('This will use the title of the page set as frontpage if left blank.', 'geodirectory'), |
|
42 | + 'id' => 'geodir_meta_title_homepage', |
|
43 | + 'type' => 'text', |
|
44 | + 'css' => 'width:100%;', |
|
45 | + 'std' => '', |
|
46 | + 'placeholder' => '' |
|
47 | + ), |
|
48 | + |
|
49 | + array( |
|
50 | + 'name' => __('Homepage meta description', 'geodirectory'), |
|
51 | + 'desc' => __('Enter the meta description for the homepage.', 'geodirectory'), |
|
52 | + 'id' => 'geodir_meta_desc_homepage', |
|
53 | + 'type' => 'textarea', |
|
54 | + 'css' => 'width:100%;', |
|
55 | + 'std' => '' |
|
56 | + ), |
|
57 | + |
|
58 | + array('type' => 'sectionend', 'id' => 'geodir_home_meta'), |
|
59 | + |
|
60 | + // details page meta |
|
61 | + array('name' => __('Details Page Meta Settings', 'geodirectory'), |
|
62 | + 'type' => 'sectionstart', |
|
63 | + 'desc' => '', |
|
64 | + 'id' => 'geodir_details_meta'), |
|
65 | + |
|
66 | + array( |
|
67 | + 'name' => __('Details page meta title', 'geodirectory'), |
|
68 | + 'desc' => __('Enter the meta title for the details page.', 'geodirectory'), |
|
69 | + 'id' => 'geodir_meta_title_detail', |
|
70 | + 'type' => 'text', |
|
71 | + 'css' => 'width:100%;', |
|
72 | + 'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'), |
|
73 | + 'placeholder' => '%%title%% %%sep%% %%sitename%%' |
|
74 | + ), |
|
75 | + |
|
76 | + array( |
|
77 | + 'name' => __('Details page meta description', 'geodirectory'), |
|
78 | + 'desc' => __('Enter the meta description for the details page.', 'geodirectory'), |
|
79 | + 'id' => 'geodir_meta_desc_detail', |
|
80 | + 'type' => 'textarea', |
|
81 | + 'css' => 'width:100%;', |
|
82 | + 'std' => __('%%excerpt%%', 'geodirectory'), |
|
83 | + 'placeholder' => '%%excerpt%%' |
|
84 | + ), |
|
85 | + |
|
86 | + array('type' => 'sectionend', 'id' => 'geodir_details_meta'), |
|
87 | + |
|
88 | + // CPT page meta |
|
89 | + array('name' => __('Post Type Page Meta Settings', 'geodirectory'), |
|
90 | + 'type' => 'sectionstart', |
|
91 | + 'desc' => '', |
|
92 | + 'id' => 'geodir_pt_meta'), |
|
93 | + |
|
94 | + array( |
|
95 | + 'name' => __('Post type page meta title', 'geodirectory'), |
|
96 | + 'desc' => __('Enter the meta title for the post type pages.', 'geodirectory'), |
|
97 | + 'id' => 'geodir_meta_title_pt', |
|
98 | + 'type' => 'text', |
|
99 | + 'css' => 'width:100%;', |
|
100 | + 'std' => __('%%pt_plural%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'), |
|
101 | + 'placeholder' => '%%pt_plural%% %%in_location%% %%sep%% %%sitename%%' |
|
102 | + ), |
|
103 | + |
|
104 | + array( |
|
105 | + 'name' => __('Post type page meta description', 'geodirectory'), |
|
106 | + 'desc' => __('Enter the meta description for the post type pages.', 'geodirectory'), |
|
107 | + 'id' => 'geodir_meta_desc_pt', |
|
108 | + 'type' => 'textarea', |
|
109 | + 'css' => 'width:100%;', |
|
110 | + 'std' => __('%%pt_plural%% %%in_location%%', 'geodirectory'), |
|
111 | + 'placeholder' => '%%pt_plural%% %%in_location%%' |
|
112 | + ), |
|
113 | + |
|
114 | + array( |
|
115 | + 'name' => __('Post type page title', 'geodirectory'), |
|
116 | + 'desc' => __('Enter the title for the post type pages.', 'geodirectory'), |
|
117 | + 'id' => 'geodir_page_title_pt', |
|
118 | + 'type' => 'text', |
|
119 | + 'css' => 'width:100%;', |
|
120 | + 'std' => __('All %%pt_plural%% %%in_location_single%%', 'geodirectory'), |
|
121 | + 'placeholder' => 'All %%pt_plural%% %%in_location_single%%' |
|
122 | + ), |
|
123 | + |
|
124 | + array('type' => 'sectionend', 'id' => 'geodir_pt_meta'), |
|
125 | + |
|
126 | + // Cat listing page meta |
|
127 | + array('name' => __('Listing Page Meta Settings', 'geodirectory'), |
|
128 | + 'type' => 'sectionstart', |
|
129 | + 'desc' => '', |
|
130 | + 'id' => 'geodir_pt_meta'), |
|
131 | + |
|
132 | + array( |
|
133 | + 'name' => __('Listing page meta title', 'geodirectory'), |
|
134 | + 'desc' => __('Enter the meta title for the category listing pages.', 'geodirectory'), |
|
135 | + 'id' => 'geodir_meta_title_listing', |
|
136 | + 'type' => 'text', |
|
137 | + 'css' => 'width:100%;', |
|
138 | + 'std' => __('%%category%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'), |
|
139 | + 'placeholder' => '%%category%% %%in_location%% %%sep%% %%sitename%%' |
|
140 | + ), |
|
141 | + |
|
142 | + array( |
|
143 | + 'name' => __('Listing page meta description', 'geodirectory'), |
|
144 | + 'desc' => __('Enter the meta description for the category listing pages.', 'geodirectory'), |
|
145 | + 'id' => 'geodir_meta_desc_listing', |
|
146 | + 'type' => 'textarea', |
|
147 | + 'css' => 'width:100%;', |
|
148 | + 'std' => __('Posts related to Category: %%category%% %%in_location%%', 'geodirectory'), |
|
149 | + 'placeholder' => 'Posts related to Category: %%category%% %%in_location%%' |
|
150 | + ), |
|
151 | + |
|
152 | + array( |
|
153 | + 'name' => __('Category listing page title', 'geodirectory'), |
|
154 | + 'desc' => __('Enter the title for the category listing pages.', 'geodirectory'), |
|
155 | + 'id' => 'geodir_page_title_cat-listing', |
|
156 | + 'type' => 'text', |
|
157 | + 'css' => 'width:100%;', |
|
158 | + 'std' => __('All %%category%% %%in_location_single%%', 'geodirectory'), |
|
159 | + 'placeholder' => 'All %%category%% %%in_location_single%%' |
|
160 | + ), |
|
161 | + |
|
162 | + array( |
|
163 | + 'name' => __('Tag listing page title', 'geodirectory'), |
|
164 | + 'desc' => __('Enter the title for the tag listing pages.', 'geodirectory'), |
|
165 | + 'id' => 'geodir_page_title_tag-listing', |
|
166 | + 'type' => 'text', |
|
167 | + 'css' => 'width:100%;', |
|
168 | + 'std' => __('Tag: %%tag%% %%in_location_single%%', 'geodirectory'), |
|
169 | + 'placeholder' => 'Tag: %%tag%% %%in_location_single%%' |
|
170 | + ), |
|
171 | + |
|
172 | + array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
173 | + |
|
174 | + // location page meta |
|
175 | + array('name' => __('Location Page Meta Settings', 'geodirectory'), |
|
176 | + 'type' => 'sectionstart', |
|
177 | + 'desc' => '', |
|
178 | + 'id' => 'geodir_pt_meta'), |
|
179 | + |
|
180 | + array( |
|
181 | + 'name' => __('Location page meta title', 'geodirectory'), |
|
182 | + 'desc' => __('Enter the meta title for the location pages.', 'geodirectory'), |
|
183 | + 'id' => 'geodir_meta_title_location', |
|
184 | + 'type' => 'text', |
|
185 | + 'css' => 'width:100%;', |
|
186 | + 'std' => __('%%title%% %%location%% %%sep%% %%sitename%%', 'geodirectory'), |
|
187 | + 'placeholder' => '%%title%% %%location%% %%sep%% %%sitename%%' |
|
188 | + ), |
|
189 | + |
|
190 | + array( |
|
191 | + 'name' => __('Location page meta description', 'geodirectory'), |
|
192 | + 'desc' => __('Enter the meta description for the location pages.', 'geodirectory'), |
|
193 | + 'id' => 'geodir_meta_desc_location', |
|
194 | + 'type' => 'textarea', |
|
195 | + 'css' => 'width:100%;', |
|
196 | + 'std' => __('%%location%%', 'geodirectory'), |
|
197 | + 'placeholder' => '%%location%%' |
|
198 | + ), |
|
199 | + |
|
200 | + array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
201 | + |
|
202 | + // Search page meta |
|
203 | + array('name' => __('Search Page Meta Settings', 'geodirectory'), |
|
204 | + 'type' => 'sectionstart', |
|
205 | + 'desc' => '', |
|
206 | + 'id' => 'geodir_pt_meta'), |
|
207 | + |
|
208 | + array( |
|
209 | + 'name' => __('Search page meta title', 'geodirectory'), |
|
210 | + 'desc' => __('Enter the meta title for the search page.', 'geodirectory'), |
|
211 | + 'id' => 'geodir_meta_title_search', |
|
212 | + 'type' => 'text', |
|
213 | + 'css' => 'width:100%;', |
|
214 | + 'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%', 'geodirectory'), |
|
215 | + 'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%' |
|
216 | + ), |
|
217 | + |
|
218 | + array( |
|
219 | + 'name' => __('Search page meta description', 'geodirectory'), |
|
220 | + 'desc' => __('Enter the meta description for the search page.', 'geodirectory'), |
|
221 | + 'id' => 'geodir_meta_desc_search', |
|
222 | + 'type' => 'textarea', |
|
223 | + 'css' => 'width:100%;', |
|
224 | + 'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%%', 'geodirectory'), |
|
225 | + 'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%%' |
|
226 | + ), |
|
227 | + |
|
228 | + array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
229 | + |
|
230 | + //Add listing page meta |
|
231 | + array('name' => __('Add Listing Page Meta Settings', 'geodirectory'), |
|
232 | + 'type' => 'sectionstart', |
|
233 | + 'desc' => '', |
|
234 | + 'id' => 'geodir_pt_meta'), |
|
235 | + |
|
236 | + array( |
|
237 | + 'name' => __('Add listing page meta title', 'geodirectory'), |
|
238 | + 'desc' => __('Enter the meta title for the add listing page.', 'geodirectory'), |
|
239 | + 'id' => 'geodir_meta_title_add-listing', |
|
240 | + 'type' => 'text', |
|
241 | + 'css' => 'width:100%;', |
|
242 | + 'std' => __('Add %%pt_single%% %%sep%% %%sitename%%', 'geodirectory'), |
|
243 | + 'placeholder' => 'Add %%pt_single%% %%sep%% %%sitename%%' |
|
244 | + ), |
|
245 | + |
|
246 | + array( |
|
247 | + 'name' => __('Add listing page meta description', 'geodirectory'), |
|
248 | + 'desc' => __('Enter the meta description for the add listing page.', 'geodirectory'), |
|
249 | + 'id' => 'geodir_meta_desc_add-listing', |
|
250 | + 'type' => 'textarea', |
|
251 | + 'css' => 'width:100%;', |
|
252 | + 'std' => __('Add %%pt_single%%', 'geodirectory'), |
|
253 | + 'placeholder' => 'Add %%pt_single%%' |
|
254 | + ), |
|
255 | + |
|
256 | + array( |
|
257 | + 'name' => __('Add listing page title', 'geodirectory'), |
|
258 | + 'desc' => __('Enter the title for the add listing page.', 'geodirectory'), |
|
259 | + 'id' => 'geodir_page_title_add-listing', |
|
260 | + 'type' => 'text', |
|
261 | + 'css' => 'width:100%;', |
|
262 | + 'std' => __('Add %%pt_single%%', 'geodirectory'), |
|
263 | + 'placeholder' => 'Add %%pt_single%%' |
|
264 | + ), |
|
265 | + |
|
266 | + array( |
|
267 | + 'name' => __('Edit listing page title', 'geodirectory'), |
|
268 | + 'desc' => __('Enter the title for the edit listing page.', 'geodirectory'), |
|
269 | + 'id' => 'geodir_page_title_edit-listing', |
|
270 | + 'type' => 'text', |
|
271 | + 'css' => 'width:100%;', |
|
272 | + 'std' => __('Edit %%pt_single%%', 'geodirectory'), |
|
273 | + 'placeholder' => 'Edit %%pt_single%%' |
|
274 | + ), |
|
275 | + |
|
276 | + array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
277 | + |
|
278 | + //Author page meta |
|
279 | + array('name' => __('Author Page Meta Settings', 'geodirectory'), |
|
280 | + 'type' => 'sectionstart', |
|
281 | + 'desc' => '', |
|
282 | + 'id' => 'geodir_pt_meta'), |
|
283 | + |
|
284 | + array( |
|
285 | + 'name' => __('Author page meta title', 'geodirectory'), |
|
286 | + 'desc' => __('Enter the meta title for the author page.', 'geodirectory'), |
|
287 | + 'id' => 'geodir_meta_title_author', |
|
288 | + 'type' => 'text', |
|
289 | + 'css' => 'width:100%;', |
|
290 | + 'std' => __('Author: %%name%% %%sep%% %%sitename%%', 'geodirectory'), |
|
291 | + 'placeholder' => 'Author: %%name%% %%sep%% %%sitename%%' |
|
292 | + ), |
|
293 | + |
|
294 | + array( |
|
295 | + 'name' => __('Author page meta description', 'geodirectory'), |
|
296 | + 'desc' => __('Enter the meta description for the author page.', 'geodirectory'), |
|
297 | + 'id' => 'geodir_meta_desc_author', |
|
298 | + 'type' => 'textarea', |
|
299 | + 'css' => 'width:100%;', |
|
300 | + 'std' => '' |
|
301 | + ), |
|
302 | + |
|
303 | + array( |
|
304 | + 'name' => __('Author page title', 'geodirectory'), |
|
305 | + 'desc' => __('Enter the title for the author page.', 'geodirectory'), |
|
306 | + 'id' => 'geodir_page_title_author', |
|
307 | + 'type' => 'text', |
|
308 | + 'css' => 'width:100%;', |
|
309 | + 'std' => __('%%pt_plural%% by: %%name%%', 'geodirectory'), |
|
310 | + 'placeholder' => '%%pt_plural%% by: %%name%%' |
|
311 | + ), |
|
312 | + |
|
313 | + array( |
|
314 | + 'name' => __('Author favorite page title', 'geodirectory'), |
|
315 | + 'desc' => __('Enter the title for the author favorite page.', 'geodirectory'), |
|
316 | + 'id' => 'geodir_page_title_favorite', |
|
317 | + 'type' => 'text', |
|
318 | + 'css' => 'width:100%;', |
|
319 | + 'std' => __('%%name%%: Favorite %%pt_plural%%', 'geodirectory'), |
|
320 | + 'placeholder' => '%%name%%: Favorite %%pt_plural%%' |
|
321 | + ), |
|
322 | + |
|
323 | + array('type' => 'sectionend', 'id' => 'geodir_location_meta'), |
|
324 | + |
|
325 | + //Login page meta |
|
326 | + array('name' => __('Login Page Meta Settings', 'geodirectory'), |
|
327 | + 'type' => 'sectionstart', |
|
328 | + 'desc' => '', |
|
329 | + 'id' => 'geodir_login_meta'), |
|
330 | + |
|
331 | + array( |
|
332 | + 'name' => __('Login page meta title', 'geodirectory'), |
|
333 | + 'desc' => __('Enter the meta title for the login page.', 'geodirectory'), |
|
334 | + 'id' => 'geodir_meta_title_login', |
|
335 | + 'type' => 'text', |
|
336 | + 'css' => 'width:100%;', |
|
337 | + 'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'), |
|
338 | + 'placeholder' => '%%title%% %%sep%% %%sitename%%' |
|
339 | + ), |
|
340 | + |
|
341 | + array( |
|
342 | + 'name' => __('Login page meta description', 'geodirectory'), |
|
343 | + 'desc' => __('Enter the meta description for the login page.', 'geodirectory'), |
|
344 | + 'id' => 'geodir_meta_desc_login', |
|
345 | + 'type' => 'textarea', |
|
346 | + 'css' => 'width:100%;', |
|
347 | + 'std' => '' |
|
348 | + ), |
|
349 | + |
|
350 | + array('type' => 'sectionend', 'id' => 'geodir_login_meta'), |
|
351 | + |
|
352 | + //Listing success page meta |
|
353 | + array('name' => __('Listing Success Page Meta Settings', 'geodirectory'), |
|
354 | + 'type' => 'sectionstart', |
|
355 | + 'desc' => '', |
|
356 | + 'id' => 'geodir_login_meta'), |
|
357 | + |
|
358 | + array( |
|
359 | + 'name' => __('Listing success page meta title', 'geodirectory'), |
|
360 | + 'desc' => __('Enter the meta title for the listing success page.', 'geodirectory'), |
|
361 | + 'id' => 'geodir_meta_title_listing-success', |
|
362 | + 'type' => 'text', |
|
363 | + 'css' => 'width:100%;', |
|
364 | + 'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'), |
|
365 | + 'placeholder' => '%%title%% %%sep%% %%sitename%%' |
|
366 | + ), |
|
367 | + |
|
368 | + array( |
|
369 | + 'name' => __('Listing success page meta description', 'geodirectory'), |
|
370 | + 'desc' => __('Enter the meta description for the listing success page.', 'geodirectory'), |
|
371 | + 'id' => 'geodir_meta_desc_listing-success', |
|
372 | + 'type' => 'textarea', |
|
373 | + 'css' => 'width:100%;', |
|
374 | + 'std' => '' |
|
375 | + ), |
|
376 | + |
|
377 | + array('type' => 'sectionend', 'id' => 'geodir_login_meta'), |
|
378 | 378 | |
379 | 379 | |
380 | 380 |