-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathxe-plugin.php
More file actions
61 lines (51 loc) · 1.62 KB
/
xe-plugin.php
File metadata and controls
61 lines (51 loc) · 1.62 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
59
60
61
<?php
/**
* Plugin Name: Xe Plugin
* Description: A modern, boilerplate WordPress plugin structure with a streamlined build process — perfect for developers building custom or commercial plugins.
* Version: 1.0.0
* Author: Muhammad Zohaib
* Author URI: https://wpguru.pk
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: xe-plugin
*
* This plugin is based on: https://github.com/zohaib87/xe-plugin
* Copyright (c) 2019 Muhammad Zohaib. Licensed under the GNU GPL v2 or later.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Plugin constants: paths, URLs, and main file references
*/
define( 'XE_PLUGIN_FILE', __FILE__ );
define( 'XE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'XE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'XE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
/**
* Composer autoload
*/
require XE_PLUGIN_PATH . 'vendor/autoload.php';
/**
* Returns the main plugin instance.
*
* Acts as a global access point for plugin services like options, paths, and URLs.
*
* @return \Xe_Plugin\Plugin Singleton instance of the Plugin class.
*/
function _xe_plugin(): \Xe_Plugin\Plugin {
return \Xe_Plugin\Plugin::instance();
}
/**
* Bootstrap the plugin.
*
* Registers all services and hooks via the Bootstrap class.
*
* @return void
*/
function _xe_plugin_bootstrap(): void {
// Initialize Plugin services
\Xe_Plugin\Plugin::instance()->register();
// Initialize Bootstrap services
$bootstrap = new \Xe_Plugin\Bootstrap();
$bootstrap->register();
}
add_action( 'plugins_loaded', '_xe_plugin_bootstrap' );