| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The public-facing functionality of the plugin. |
| 5 |
* |
| 6 |
* Defines the plugin name, version, and two examples hooks for how to |
| 7 |
* enqueue the public-facing stylesheet and JavaScript. |
| 8 |
* |
| 9 |
* @link https://themeatelier.net |
| 10 |
* @since 1.0.0 |
| 11 |
* |
| 12 |
* @package darkify |
| 13 |
* @subpackage darkify/src/Helpers |
| 14 |
* @author ThemeAtelier<themeatelierbd@gmail.com> |
| 15 |
*/ |
| 16 |
|
| 17 |
namespace ThemeAtelier\Darkify\Helpers; |
| 18 |
|
| 19 |
/** |
| 20 |
* The Helpers class to manage all public facing stuffs. |
| 21 |
* |
| 22 |
* @since 1.0.0 |
| 23 |
*/ |
| 24 |
class Helpers |
| 25 |
{ |
| 26 |
/** |
| 27 |
* Custom Template locator . |
| 28 |
* |
| 29 |
* @param mixed $template_name template name . |
| 30 |
* @param mixed $template_path template path . |
| 31 |
* @param mixed $default_path default path . |
| 32 |
* @return string |
| 33 |
*/ |
| 34 |
public static function darkify_locate_template($template_name, $default_path = '') |
| 35 |
{ |
| 36 |
if (!$default_path) { |
| 37 |
$default_path = DARKIFY_PATH . 'src/Frontend/Templates/'; |
| 38 |
} |
| 39 |
$template = locate_template($template_name); |
| 40 |
// Get default template. |
| 41 |
if (!$template) { |
| 42 |
$template = $default_path . $template_name; |
| 43 |
} |
| 44 |
// Return what we found. |
| 45 |
return $template; |
| 46 |
} |
| 47 |
} |
| 48 |
|