-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv-indicator.php
More file actions
39 lines (31 loc) · 808 Bytes
/
env-indicator.php
File metadata and controls
39 lines (31 loc) · 808 Bytes
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
<?php
/*
* @wordpress-plugin
* Plugin Name: Environment Indicator.
* Description: Shows the current environment on WP admin bar.
* Version: 1.0.0
* License: GPLv2+
* Requires at least: 6.3
* Requires PHP: 8.0
* Update URI: false
*/
declare(strict_types=1);
namespace Lax\EnvIndicator;
use Inpsyde\Modularity;
is_readable(__DIR__ . '/vendor/autoload.php') && require_once __DIR__ . '/vendor/autoload.php';
function plugin(): Modularity\Package
{
static $package;
if (!$package) {
$properties = Modularity\Properties\PluginProperties::new(__FILE__);
$package = Modularity\Package::new($properties)
->addModule(new EnvModule());
}
return $package;
}
add_action(
'plugins_loaded',
static function (): void {
plugin()->boot();
}
);