@@ -83,14 +83,16 @@ discard block |
||
83 | 83 | $success_page_id = geodir_success_page_id(); |
84 | 84 | if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
85 | 85 | && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
86 | - ) |
|
87 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
86 | + ) { |
|
87 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
88 | + } |
|
88 | 89 | return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
89 | 90 | break; |
90 | 91 | case 'detail': |
91 | 92 | case 'preview': |
92 | - if (in_array(get_post_type(), geodir_get_posttypes())) |
|
93 | - $post_type = get_post_type(); |
|
93 | + if (in_array(get_post_type(), geodir_get_posttypes())) { |
|
94 | + $post_type = get_post_type(); |
|
95 | + } |
|
94 | 96 | return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
95 | 97 | break; |
96 | 98 | case 'listing': |
@@ -196,7 +198,9 @@ discard block |
||
196 | 198 | |
197 | 199 | $template = geodir_locate_template('signup'); |
198 | 200 | |
199 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
201 | + if (!$template) { |
|
202 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
203 | + } |
|
200 | 204 | |
201 | 205 | /** |
202 | 206 | * Filter the signup template path. |
@@ -214,7 +218,9 @@ discard block |
||
214 | 218 | |
215 | 219 | $template = geodir_locate_template('information'); |
216 | 220 | |
217 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
221 | + if (!$template) { |
|
222 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
223 | + } |
|
218 | 224 | /** |
219 | 225 | * Filter the information template path. |
220 | 226 | * |
@@ -248,7 +254,9 @@ discard block |
||
248 | 254 | if (!$is_current_user_owner) { |
249 | 255 | $template = geodir_locate_template('information'); |
250 | 256 | |
251 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
257 | + if (!$template) { |
|
258 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
259 | + } |
|
252 | 260 | /** |
253 | 261 | * Filter the information template path. |
254 | 262 | * |
@@ -270,7 +278,9 @@ discard block |
||
270 | 278 | |
271 | 279 | $template = geodir_locate_template('add-listing'); |
272 | 280 | |
273 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
281 | + if (!$template) { |
|
282 | + $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
283 | + } |
|
274 | 284 | /** |
275 | 285 | * Filter the add listing template path. |
276 | 286 | * |
@@ -287,7 +297,9 @@ discard block |
||
287 | 297 | |
288 | 298 | $template = geodir_locate_template('preview'); |
289 | 299 | |
290 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
300 | + if (!$template) { |
|
301 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
302 | + } |
|
291 | 303 | /** |
292 | 304 | * Filter the preview template path. |
293 | 305 | * |
@@ -303,7 +315,9 @@ discard block |
||
303 | 315 | |
304 | 316 | $template = geodir_locate_template('success'); |
305 | 317 | |
306 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
318 | + if (!$template) { |
|
319 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
320 | + } |
|
307 | 321 | /** |
308 | 322 | * Filter the success template path. |
309 | 323 | * |
@@ -318,7 +332,9 @@ discard block |
||
318 | 332 | |
319 | 333 | $template = geodir_locate_template('detail'); |
320 | 334 | |
321 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
335 | + if (!$template) { |
|
336 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
337 | + } |
|
322 | 338 | /** |
323 | 339 | * Filter the detail template path. |
324 | 340 | * |
@@ -333,7 +349,9 @@ discard block |
||
333 | 349 | |
334 | 350 | $template = geodir_locate_template('listing'); |
335 | 351 | |
336 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
352 | + if (!$template) { |
|
353 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
354 | + } |
|
337 | 355 | /** |
338 | 356 | * Filter the listing template path. |
339 | 357 | * |
@@ -348,7 +366,9 @@ discard block |
||
348 | 366 | |
349 | 367 | $template = geodir_locate_template('search'); |
350 | 368 | |
351 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
369 | + if (!$template) { |
|
370 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
371 | + } |
|
352 | 372 | /** |
353 | 373 | * Filter the search template path. |
354 | 374 | * |
@@ -363,7 +383,9 @@ discard block |
||
363 | 383 | |
364 | 384 | $template = geodir_locate_template('author'); |
365 | 385 | |
366 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
386 | + if (!$template) { |
|
387 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
388 | + } |
|
367 | 389 | /** |
368 | 390 | * Filter the author template path. |
369 | 391 | * |
@@ -384,7 +406,9 @@ discard block |
||
384 | 406 | |
385 | 407 | $template = geodir_locate_template('geodir-home'); |
386 | 408 | |
387 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
409 | + if (!$template) { |
|
410 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
411 | + } |
|
388 | 412 | /** |
389 | 413 | * Filter the home page template path. |
390 | 414 | * |
@@ -397,7 +421,9 @@ discard block |
||
397 | 421 | |
398 | 422 | $template = geodir_locate_template('location'); |
399 | 423 | |
400 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
424 | + if (!$template) { |
|
425 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
426 | + } |
|
401 | 427 | /** |
402 | 428 | * Filter the location template path. |
403 | 429 | * |
@@ -406,8 +432,9 @@ discard block |
||
406 | 432 | */ |
407 | 433 | return $template = apply_filters('geodir_template_location', $template); |
408 | 434 | |
409 | - } else |
|
410 | - return $template; |
|
435 | + } else { |
|
436 | + return $template; |
|
437 | + } |
|
411 | 438 | |
412 | 439 | } |
413 | 440 | |
@@ -461,8 +488,10 @@ discard block |
||
461 | 488 | * @since 1.0.0 |
462 | 489 | */ |
463 | 490 | include($template); |
464 | - else: |
|
465 | - locate_template(array("geodirectory/" . $template_name), true, false); |
|
491 | + else { |
|
492 | + : |
|
493 | + locate_template(array("geodirectory/" . $template_name), true, false); |
|
494 | + } |
|
466 | 495 | endif; |
467 | 496 | |
468 | 497 | } |