forked from torounit/custom-post-type-permalinks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPTP.php
87 lines (67 loc) · 1.38 KB
/
CPTP.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
<?php
/**
* CPTP
*
* Facade.
*
* @package Custom_Post_Type_Permalinks
* @since 0.9.4
*
* */
define( "CPTP_VERSION", "0.9.5.6" );
define( "CPTP_DEFAULT_PERMALINK", "/%postname%/" );
define( "CPTP_DIR", dirname( __FILE__ ) );
require_once CPTP_DIR.'/CPTP/Util.php';
require_once CPTP_DIR.'/CPTP/Module.php';
require_once CPTP_DIR.'/CPTP/Module/Setting.php';
require_once CPTP_DIR.'/CPTP/Module/Rewrite.php';
require_once CPTP_DIR.'/CPTP/Module/Admin.php';
require_once CPTP_DIR.'/CPTP/Module/Permalink.php';
require_once CPTP_DIR.'/CPTP/Module/GetArchives.php';
require_once CPTP_DIR.'/CPTP/Module/FlushRules.php';
class CPTP {
private static $instance;
private function __construct() {
$this->load_modules();
$this->init();
}
/**
*
* load_modules
*
* Load CPTP_Modules.
* @since 0.9.5
*
* */
private function load_modules() {
new CPTP_Module_Setting();
new CPTP_Module_Rewrite();
new CPTP_Module_Admin();
new CPTP_Module_Permalink();
new CPTP_Module_GetArchives();
new CPTP_Module_FlushRules();
do_action( "CPTP_load_modules" );
}
/**
*
* init
*
* Fire Module::add_hook
*
* @since 0.9.5
*
* */
private function init() {
do_action( "CPTP_init" );
}
/**
* Singleton
* @static
*/
public static function get_instance() {
if (!isset(self::$_instance)) {
self::$instance = new CPTP;
}
return self::$instance;
}
}