comparison
4 years ago
quick-view
4 years ago
swatches
4 years ago
wishlist
4 years ago
manifest.php
4 years ago
manifest.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ShopEngine\Modules; |
| 4 | |
| 5 | defined('ABSPATH') || exit; |
| 6 | |
| 7 | use ShopEngine\Core\Register\Module_List; |
| 8 | |
| 9 | |
| 10 | class Manifest |
| 11 | { |
| 12 | |
| 13 | private $module_list; |
| 14 | |
| 15 | public function init() { |
| 16 | |
| 17 | add_action('init', [$this, 'manifest_modules'], 0); |
| 18 | } |
| 19 | |
| 20 | public function manifest_modules() { |
| 21 | |
| 22 | foreach(Module_List::instance()->get_list(true, 'active') as $module) { |
| 23 | |
| 24 | if($module['status'] != 'active') { |
| 25 | continue; |
| 26 | } |
| 27 | |
| 28 | if(isset($module['path'])) { |
| 29 | |
| 30 | $fl = $module['path'] . '/' . $module['slug'] . '.php'; |
| 31 | |
| 32 | if(file_exists($fl)) { |
| 33 | |
| 34 | require_once $fl; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | $module['base_class']::instance()->init(); |
| 39 | |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 |