-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
79 lines (67 loc) · 1.73 KB
/
plugin.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php // phpcs:ignore PSR1.Files.SideEffects.FoundWithSymbols // impossible to do it another way
/**
* Plugin Name: figuren.theater | Core
* Plugin URI: https://github.com/figuren-theater/ft-core
* Description: Core components for a WordPress multisite plattform like figuren.theater
* Author: figuren.theater
* Author URI: https://figuren.theater
* Text Domain: figurentheater
* Domain Path: /languages
* Version: 1.2.21
*
* @package Figuren_Theater
*/
namespace Figuren_Theater;
use add_action;
use add_filter;
use Altis;
use do_action;
use FT_ROOT_DIR;
const DIRECTORY = __DIR__;
// This is usually done in altis/wp-config.php and needed in 'figuren-theater/altis-core'.
define( 'Altis\ROOT_DIR', FT_ROOT_DIR );
/**
* This is the replacement for
* https://github.com/figuren-theater/altis-core/blob/master/load.php
* which is not loaded as usual.
*
* Here only ~50% of the humanmade-original are loaded.
*
* ------------------------------------------------------------------
*
* Main entry point loader for the Core module.
*
* @package altis/core
*/
// Patch plugins URL for vendor directory.
add_filter( 'plugins_url', __NAMESPACE__ . '\\fix_plugins_url', 1000, 3 );
// 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.
Altis\load_enabled_modules();
},
0
);
// Register core module.
add_action(
'altis.modules.init',
function () {
Altis\register_module(
'core',
DIRECTORY,
'Core',
[
'defaults' => [
'enabled' => true,
],
],
__NAMESPACE__ . '\\bootstrap'
);
}
);