-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
85 lines (76 loc) · 1.81 KB
/
init.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
<?php
/*
Plugin Name: Module Kit
Description: A WordPress Plugin for projects to combine disparate functions
Version: 0.9.0
Author: Garret McGraw-Hanson
Author URI: http://garretmh.github.com
*/
if ( ! class_exists( 'MK_Bootstrap', false ) ) {
/**
* Handles checking for and loading the Module Kit and its dependencies
*/
class MK_Bootstrap {
/**
* The name of this class
*
* @var string
*/
public static $name = __CLASS__;
/**
* Single instance of the MK_Bootstrap object
*
* @var MK_Bootstrap
*/
public static $single_instance = null;
/**
* Creates/returns the single instance MK_Bootstrap object
*
* @return MK_Bootstrap Single instance object
*/
public static function initiate() {
if ( null === self::$single_instance ) {
self::$single_instance = new self();
}
return self::$single_instance;
}
/**
* Start the plugin
*
* Sets up globals and plugin hooks
*/
private function __construct() {
# Setup hooks & shortcodes
add_action( 'init', [__CLASS__, 'bootstrap'], 20 );
# Initilize
require_once 'inc/CMB2/init.php';
include_once 'inc/class-template-loader.php';
include_once 'inc/class-options.php';
require_once 'inc/abstract-module.php';
require_once 'module.php';
# Initialization Complete.
}
/**
* Module Kit bootstrap proccess
*/
public static function bootstrap() {
if ( is_admin() ) {
/**
* Fires on the admin side when the Module Kit is included/loaded.
*/
do_action( 'mk_admin_init' );
}
/**
* Fires when the Module Kit is included/loaded
*
* Can be used to add modules
*/
do_action( 'mk_init' );
/**
* Fires after the Module Kit initiation process has been completed
*/
do_action( 'mk_after_init' );
}
} # End class.
}
MK_Bootstrap::initiate();