-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathonekninetynineify.php
165 lines (130 loc) · 3.81 KB
/
onekninetynineify.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?php
/**
* Plugin Name: One Thousand Nine Hundred and Ninety-Nineify
* Plugin URI: https://github.com/thomasplevy/onekninetynineify
* Description: This plugin's got its JNCO pockets full of all tools you'll need to make the coolest site on the web!
* Version: 0.0.3
* Author: The Guy Who May Have Ruined Your Website in 2017
* Author URI: https://github.com/thomasplevy
* Text Domain: onekninetynineify
* Domain Path: /i18n
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
/**
* Restrict direct access
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'OneK99ify' ) ) :
final class OneK99ify {
/**
* Current version of the plugin
* @var string
*/
public $version = '0.0.3';
/**
* Singleton instance of the class
* @var obj
*/
private static $_instance = null;
/**
* Singleton Instance of the OneK99ify class
* @return obj instance of the OneK99ify class
* @since 0.0.1
* @version 0.0.1
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Constructor
* @return void
* @since 0.0.1
* @version 0.0.1
*/
private function __construct() {
// define plugin constants
$this->define_constants();
add_action( 'init', array( $this, 'load_textdomain' ), 0 );
// get started
add_action( 'plugins_loaded', array( $this, 'init' ) );
}
/**
* Define all constants used by the plugin
* @return void
* @since 0.0.1
* @version 0.0.1
*/
private function define_constants() {
if ( ! defined( 'ONEK99IFY_PLUGIN_FILE' ) ) {
define( 'ONEK99IFY_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'ONEK99IFY_PLUGIN_DIR' ) ) {
define( 'ONEK99IFY_PLUGIN_DIR', WP_PLUGIN_DIR . "/" . plugin_basename( dirname(__FILE__) ) . '/' );
}
if ( ! defined( 'ONEK99IFY_VERSION' ) ) {
define( 'ONEK99IFY_VERSION', $this->version );
}
}
/**
* Include files and instantiate classes
* @return void
* @since 0.0.1
* @version 0.0.1
*/
private function includes() {
require_once ONEK99IFY_PLUGIN_DIR . 'includes/functions-onek99ify.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-assets.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-customizer.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-mouse-trail.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-shortcode-marquee.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-stats.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-widget-email.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-widget-stats.php';
require_once ONEK99IFY_PLUGIN_DIR . 'includes/class-onek99ify-widgets.php';
}
/**
* Include all required files and classes
* @return void
* @since 0.0.1
* @version 0.0.1
*/
public function init() {
$this->includes();
}
/**
* Load l10n files
* The first loaded file takes priority
*
* Files can be found in the following order:
* WP_LANG_DIR/lifterlms/onekninetynineify-LOCALE.mo
* WP_LANG_DIR/plugins/onekninetynineify-LOCALE.mo
*
* @return void
* @since 0.0.1
* @version 0.0.1
*/
public function load_textdomain() {
// load locale
$locale = apply_filters( 'plugin_locale', get_locale(), 'onekninetynineify' );
// load a lifterlms specific locale file if one exists
load_textdomain( 'onekninetynineify', WP_LANG_DIR . '/lifterlms/onekninetynineify-' . $locale . '.mo' );
// load localization files
load_plugin_textdomain( 'onekninetynineify', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
}
endif;
/**
* Main Plugin Instance
* @since 0.0.1
* @version 0.0.1
*/
function OneK99ify() {
return OneK99ify::instance();
}
return OneK99ify();