1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* The plugin bootstrap file. |
5
|
|
|
* |
6
|
|
|
* This file is read by WordPress to generate the plugin information in the plugin |
7
|
|
|
* admin area. This file also includes all of the dependencies used by the plugin, |
8
|
|
|
* registers the activation and deactivation functions, and defines a function |
9
|
|
|
* that starts the plugin. |
10
|
|
|
* |
11
|
|
|
* @link https://github.com/maab16 |
12
|
|
|
* @since 1.0.0 |
13
|
|
|
* |
14
|
|
|
* @wordpress-plugin |
15
|
|
|
* Plugin Name: WPB |
16
|
|
|
* Plugin URI: https://github.com/Codexshaper/wpb-framework |
17
|
|
|
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. |
18
|
|
|
* Version: 1.0.0 |
19
|
|
|
* Author: Md Abu Ahsan basir |
20
|
|
|
* Author URI: https://github.com/maab16 |
21
|
|
|
* License: GPL-2.0+ |
22
|
|
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
23
|
|
|
* Text Domain: wpb |
24
|
|
|
* Domain Path: /languages |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
// If this file is called directly, abort. |
28
|
|
|
if (!defined('WPINC')) { |
29
|
|
|
die; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
// Application root directory. |
33
|
|
|
if (!defined('WPB_APP_ROOT')) { |
34
|
|
|
define('WPB_APP_ROOT', __DIR__); |
35
|
|
|
} |
36
|
|
|
// Worpress plugin builder file path. |
37
|
|
|
if (!defined('WPB_FILE')) { |
38
|
|
|
define('WPB_FILE', __FILE__); |
39
|
|
|
} |
40
|
|
|
// Worpress plugin builder directory path. |
41
|
|
|
if (!defined('WPB_PATH')) { |
42
|
|
|
define('WPB_PATH', dirname(WPB_FILE)); |
43
|
|
|
} |
44
|
|
|
// Worpress plugin builder includes path. |
45
|
|
|
if (!defined('WPB_INCLUDES')) { |
46
|
|
|
define('WPB_INCLUDES', WPB_PATH.'/includes'); |
47
|
|
|
} |
48
|
|
|
// Worpress plugin builder url. |
49
|
|
|
if (!defined('WPB_URL')) { |
50
|
|
|
define('WPB_URL', plugins_url('', WPB_FILE)); |
|
|
|
|
51
|
|
|
} |
52
|
|
|
// Worpress plugin builder assets path. |
53
|
|
|
if (!defined('WPB_ASSETS')) { |
54
|
|
|
define('WPB_ASSETS', WPB_URL.'/public'); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
require_once __DIR__.'/bootstrap/app.php'; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Currently plugin version. |
61
|
|
|
* Start at version 1.0.0 and use SemVer - https://semver.org |
62
|
|
|
* Rename this for your plugin and update it as you release new versions. |
63
|
|
|
*/ |
64
|
|
|
define('WPB_VERSION', '1.0.0'); |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* The code that runs during plugin activation. |
68
|
|
|
* This action is documented in includes/class-wpb-activator.php. |
69
|
|
|
*/ |
70
|
|
|
function wpb_activate() |
71
|
|
|
{ |
72
|
|
|
require_once plugin_dir_path(__FILE__).'includes/class-wpb-activator.php'; |
|
|
|
|
73
|
|
|
WPB_Activator::activate(); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* The code that runs during plugin deactivation. |
78
|
|
|
* This action is documented in includes/class-wpb-deactivator.php. |
79
|
|
|
*/ |
80
|
|
|
function wpb_deactivate() |
81
|
|
|
{ |
82
|
|
|
require_once plugin_dir_path(__FILE__).'includes/class-wpb-deactivator.php'; |
|
|
|
|
83
|
|
|
WPB_Deactivator::deactivate(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
register_activation_hook(__FILE__, 'wpb_activate'); |
|
|
|
|
87
|
|
|
register_deactivation_hook(__FILE__, 'wpb_deactivate'); |
|
|
|
|
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* The core plugin class that is used to define internationalization, |
91
|
|
|
* admin-specific hooks, and public-facing site hooks. |
92
|
|
|
*/ |
93
|
|
|
require plugin_dir_path(__FILE__).'includes/class-wpb.php'; |
|
|
|
|
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* Begins execution of the plugin. |
97
|
|
|
* |
98
|
|
|
* Since everything within the plugin is registered via hooks, |
99
|
|
|
* then kicking off the plugin from this point in the file does |
100
|
|
|
* not affect the page life cycle. |
101
|
|
|
* |
102
|
|
|
* @since 1.0.0 |
103
|
|
|
*/ |
104
|
|
|
function wpb_run() |
105
|
|
|
{ |
106
|
|
|
$plugin = new WPB(); |
107
|
|
|
$plugin->run(); |
108
|
|
|
} |
109
|
|
|
wpb_run(); |
110
|
|
|
|