-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaxframework.php
More file actions
58 lines (45 loc) · 1.4 KB
/
waxframework.php
File metadata and controls
58 lines (45 loc) · 1.4 KB
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
<?php
defined( 'ABSPATH' ) || exit;
use MyPluginNamespace\WaxFramework\App;
/**
* Plugin Name: MyPluginName
* Description: This plugin is build with Wax framework
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Tested up to: 6.2
* Author: SovWare
* Author URI: http://github.com/sovware
* License: GPL v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: MyPluginTextDomain
* Domain Path: /languages
*/
require_once __DIR__ . '/vendor/vendor-src/autoload.php';
require_once __DIR__ . '/app/Helpers/helper.php';
final class MyPluginClass
{
public static MyPluginClass $instance;
public static function instance(): MyPluginClass {
if ( empty( self::$instance ) ) {
self::$instance = new self;
}
return self::$instance;
}
public function load() {
$application = App::instance();
$application->boot( __FILE__, __DIR__ );
/**
* Fires once activated plugins have loaded.
*
*/
add_action(
'plugins_loaded', function () use ( $application ): void {
do_action( 'before_load_my_plugin_hook' );
$application->load();
do_action( 'after_load_my_plugin_hook' );
}
);
}
}
MyPluginClass::instance()->load();