-
Notifications
You must be signed in to change notification settings - Fork 4
/
bootstrap.php
95 lines (85 loc) · 1.62 KB
/
bootstrap.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* Starter Plugin
*
* @package KnowTheCode\StarterPlugin
* @author hellofromTonya
* @license GPL-2.0+
*
* @wordpress-plugin
* Plugin Name: Starter Plugin
* Plugin URI: https://github.com/KnowTheCode/starter-plugin
* Description: A WordPress plugin boilerplate that emphasizes code quality and provides you a quick start to your custom plugin development project.
* Version: 1.0.0
* Author: hellofromTonya
* Author URI: https://KnowTheCode.io
* Text Domain: starter-plugin
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
namespace KnowTheCode\StarterPlugin;
/**
* Gets this plugin's absolute directory path.
*
* @since 1.0.0
* @ignore
* @access private
*
* @return string
*/
function _get_plugin_directory() {
return __DIR__;
}
/**
* Gets this plugin's URL.
*
* @since 1.0.0
* @ignore
* @access private
*
* @return string
*/
function _get_plugin_url() {
static $plugin_url;
if ( empty( $plugin_url ) ) {
$plugin_url = plugins_url( null, __FILE__ );
}
return $plugin_url;
}
/**
* Checks if this plugin is in development mode.
*
* @since 1.0.0
* @ignore
* @access private
*
* @return bool
*/
function _is_in_development_mode() {
return defined( WP_DEBUG ) && WP_DEBUG === true;
}
/**
* Autoload the plugin's files.
*
* @since 1.0.0
*
* @return void
*/
function autoload_files() {
$files = array(// add the list of files to load here.
);
foreach ( $files as $file ) {
require __DIR__ . '/src/' . $file;
}
}
/**
* Launch the plugin.
*
* @since 1.0.0
*
* @return void
*/
function launch() {
autoload_files();
}
launch();