-
Notifications
You must be signed in to change notification settings - Fork 9
/
pm2-modern-plugin.php
62 lines (54 loc) · 1.25 KB
/
pm2-modern-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
<?php
/**
* Plugin Name: PLUGIN_NAME
* Description: PLUGIN_DESCRIPTION
* Requires at least: 6.1
* Requires PHP: 7.4
* Version: 0.1.0
* Author: PLUGIN_AUTHOR_NAME
* Author URI: https://PLUGIN_AUTHOR_URI
* Plugin URI: https://PLUGIN_URI/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: pm2-modern-plugin
*
*/
use VendorNamespace\PluginNamespace\Settings;
use VendorNamespace\PluginNamespace\Plugin;
/**
* Shortcut constant to the path of this file.
*/
define( 'PM2_MODERN_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
/**
* Version of the plugin.
*/
define( 'PM2_MODERN_VERSION', '1.0.0' );
/**
* Main file of plugin
*/
define( 'PM2_MODERN_MAIN_FILE', __FILE__ );
// include autoloader from composer
require_once __DIR__ . '/vendor/autoload.php';
//Register block built in build/block.js
add_action( 'init', function(){
register_block_type( PM2_MODERN_PLUGIN_DIR . '/build/block' );
} );
//Setup plugin
add_action(
'ACTION_PREFIX_init',
function ( Plugin $plugin ) {
$plugin->init();
}
);
/**
* Start Plugin
*
* @since 1.0.0
* @param Plugin $plugin
*/
do_action(
'ACTION_PREFIX_init',
new Plugin(
new Settings(),
)
);