-
Notifications
You must be signed in to change notification settings - Fork 1
/
docu.php
89 lines (59 loc) · 2.25 KB
/
docu.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
<?php
/*
* Plugin Name: Docu
* Version: 1.5
* Plugin URI: http://wp.dinamiko.com/demos/docu
* Description: A simple Documentation Plugin
* Author: Emili Castells
* Author URI: http://www.dinamiko.com
* Requires at least: 3.9
* Tested up to: 4.2.2
*
* Text Domain: docu
* Domain Path: /languages/
*/
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'Docu' ) ) {
final class Docu {
private static $instance;
public static function instance() {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Docu ) ) {
self::$instance = new Docu;
self::$instance->setup_constants();
add_action( 'plugins_loaded', array( self::$instance, 'docu_load_textdomain' ) );
self::$instance->includes();
}
return self::$instance;
}
public function docu_load_textdomain() {
load_plugin_textdomain( 'docu', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
private function setup_constants() {
if ( ! defined( 'DOCU_VERSION' ) ) { define( 'DOCU_VERSION', '1.5' ); }
if ( ! defined( 'DOCU_PLUGIN_DIR' ) ) { define( 'DOCU_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); }
if ( ! defined( 'DOCU_PLUGIN_URL' ) ) { define( 'DOCUPLUGIN_URL', plugin_dir_url( __FILE__ ) ); }
if ( ! defined( 'DOCU_PLUGIN_FILE' ) ) { define( 'DOCU_PLUGIN_FILE', __FILE__ ); }
}
private function includes() {
require_once DOCU_PLUGIN_DIR . 'includes/post-types.php';
require_once DOCU_PLUGIN_DIR . 'includes/load-js-css.php';
require_once DOCU_PLUGIN_DIR . 'includes/docu-functions.php';
//require_once DOCU_PLUGIN_DIR . 'includes/class-gamajo-template-loader.php';
require_once DOCU_PLUGIN_DIR . 'includes/class-docu-template-loader.php';
require_once DOCU_PLUGIN_DIR . 'includes/shortcodes.php';
require_once DOCU_PLUGIN_DIR . 'includes/sortable/sortable.php';
require_once DOCU_PLUGIN_DIR . 'includes/widgets.php';
require_once DOCU_PLUGIN_DIR . 'includes/install.php';
}
public function __clone() {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'docu' ), DOCU_VERSION );
}
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'docu' ), DOCU_VERSION );
}
}
}
function Docu() {
return Docu::instance();
}
Docu();