-
Notifications
You must be signed in to change notification settings - Fork 11
/
plugin-slug.php
51 lines (43 loc) · 1.34 KB
/
plugin-slug.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
<?php
/**
* Plugin Name
*
* @package Gamajo\PluginSlug
* @author Gary Jones
* @copyright 2024 Gary Jones
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: Plugin Boilerplate
* Plugin URI: https://github.com/garyjones/...
* Description: ...
* Version: 0.1.0
* Author: Gary Jones
* Author URI: https://garyjones.io
* Text Domain: plugin-slug
* License: GPL-2.0-or-later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* GitHub Plugin URI: https://github.com/garyjones/...
* Requires PHP: 8.2
* Requires WP: 6.6
*/
declare( strict_types = 1 );
namespace Gamajo\PluginSlug;
use BrightNucleus\Config\ConfigFactory;
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( ! defined( 'PLUGIN_SLUG_DIR' ) ) {
define( 'PLUGIN_SLUG_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'PLUGIN_SLUG_URL' ) ) {
define( 'PLUGIN_SLUG_URL', plugin_dir_url( __FILE__ ) );
}
// Load Composer autoloader.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
// Initialize the plugin.
$GLOBALS['plugin_slug'] = new Plugin( ConfigFactory::create( __DIR__ . '/config/defaults.php' )->getSubConfig( 'Gamajo\PluginSlug' ) );
$GLOBALS['plugin_slug']->run();