| 1 |
<?php |
| 2 |
/** |
| 3 |
* Block Loader Module |
| 4 |
* |
| 5 |
* Loads all the block related code. |
| 6 |
* |
| 7 |
* @package Genesis\Blocks\BlockLoader |
| 8 |
* @since 1.0.0 |
| 9 |
* @author StudioPress |
| 10 |
* @license GPL-2.0-or-later |
| 11 |
* @link https://github.com/studiopress/genesis-blocks/ |
| 12 |
*/ |
| 13 |
|
| 14 |
declare(strict_types=1); |
| 15 |
namespace Genesis\Blocks\BlockLoader; |
| 16 |
|
| 17 |
use Genesis\Blocks\Interfaces\ModuleInterface; |
| 18 |
|
| 19 |
/** |
| 20 |
* Module class |
| 21 |
* Allow Genesis Blocks to initiate this module. |
| 22 |
* |
| 23 |
* @since 1.0.0 |
| 24 |
* @uses \Genesis\Blocks\Interface\ModuleInterface |
| 25 |
*/ |
| 26 |
final class Module implements ModuleInterface { |
| 27 |
/** |
| 28 |
* Checks if this module is enabled. |
| 29 |
* |
| 30 |
* Modules can specify conditions when they should be disabled (other plugin |
| 31 |
* is active, or in response to a user preference). Can also be used to |
| 32 |
* quickly disable a module manually by editing the is_enabled return value. |
| 33 |
* |
| 34 |
* @since 1.0.0 |
| 35 |
* @return bool |
| 36 |
*/ |
| 37 |
public function is_enabled(): bool { |
| 38 |
return true; |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Module Activation |
| 43 |
* Logic to be run when this module is activated. |
| 44 |
* |
| 45 |
* @since 1.0.0 |
| 46 |
* @uses Genesis\Blocks\BlockLoader; |
| 47 |
* @param array $context Current environment information. |
| 48 |
* |
| 49 |
* @return void |
| 50 |
*/ |
| 51 |
public function activate( array $context ): void { |
| 52 |
( new ManualRequire( $context ) )->init(); |
| 53 |
} |
| 54 |
} |
| 55 |
|