forked from wp-oop/plugin-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
31 lines (27 loc) · 809 Bytes
/
plugin.php
File metadata and controls
31 lines (27 loc) · 809 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
<?php
/**
* My WordPress plugin.
*
* @wordpress-plugin
*
* Plugin Name: My WordPress Plugin
* Description: A project skeleton useful for starting a new WordPress plugin
* Version: 0.1.0-alpha1
* Author: Me
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: plugin
* Domain Path: /languages
*/
(function (string $mainFile): void {
$rootDir = dirname($mainFile);
$autoload = "$rootDir/vendor/composer/autoload.php";
if (file_exists($autoload)) {
require $autoload;
}
add_action('plugins_loaded', function () use ($mainFile, $rootDir) {
$incDir = "$rootDir/inc";
$bootstrap = require "$incDir/bootstrap.php";
$appContainer = $bootstrap($rootDir, $mainFile);
});
})(__FILE__);