| 1 |
<?php |
| 2 |
/** |
| 3 |
* Manage any frontend related tasks here. |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace Extendify\Library; |
| 7 |
|
| 8 |
use Extendify\Config; |
| 9 |
|
| 10 |
/** |
| 11 |
* This class handles any file loading for the frontend of the site. |
| 12 |
*/ |
| 13 |
class Frontend |
| 14 |
{ |
| 15 |
|
| 16 |
/** |
| 17 |
* The instance |
| 18 |
* |
| 19 |
* @var $instance |
| 20 |
*/ |
| 21 |
public static $instance = null; |
| 22 |
|
| 23 |
/** |
| 24 |
* Adds various actions to set up the page |
| 25 |
* |
| 26 |
* @return self|void |
| 27 |
*/ |
| 28 |
public function __construct() |
| 29 |
{ |
| 30 |
if (self::$instance) { |
| 31 |
return self::$instance; |
| 32 |
} |
| 33 |
|
| 34 |
self::$instance = $this; |
| 35 |
$this->loadScripts(); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Adds scripts and styles to every page is enabled |
| 40 |
* |
| 41 |
* @return void |
| 42 |
*/ |
| 43 |
public function loadScripts() |
| 44 |
{ |
| 45 |
\add_action( |
| 46 |
'wp_enqueue_scripts', |
| 47 |
function () { |
| 48 |
// TODO: Determine a way to conditionally load assets (https://github.com/extendify/company-product/issues/72). |
| 49 |
$this->addStylesheets(); |
| 50 |
} |
| 51 |
); |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Adds stylesheets as needed |
| 56 |
* |
| 57 |
* @return void |
| 58 |
*/ |
| 59 |
public function addStylesheets() |
| 60 |
{ |
| 61 |
} |
| 62 |
} |
| 63 |
|