-
Notifications
You must be signed in to change notification settings - Fork 4
/
load.php
47 lines (40 loc) · 1001 Bytes
/
load.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Main entry point loader for the Core module.
*
* @package altis/core
*/
namespace Altis;
// Patch plugins URL for vendor directory.
add_filter( 'plugins_url', 'Altis\\fix_plugins_url', 10, 3 );
// Ensure WP_ENVIRONMENT_TYPE is set.
add_action( 'altis.loaded_autoloader', 'Altis\\set_wp_environment_type', -10 );
// Fire module init hook and load enabled modules.
add_action( 'altis.loaded_autoloader', function () {
/**
* Modules should register themselves on this hook.
*/
do_action( 'altis.modules.init' );
// Load modules.
load_enabled_modules();
}, 0 );
// Register core module.
add_action( 'altis.modules.init', function () {
register_module(
'core',
__DIR__,
'Core',
[
'defaults' => [
'enabled' => true,
],
],
__NAMESPACE__ . '\\bootstrap'
);
} );
// Load config entry point.
add_action( 'altis.loaded_autoloader', function () {
if ( file_exists( ROOT_DIR . '/.config/load.php' ) ) {
require_once ROOT_DIR . '/.config/load.php';
}
} );