-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmp-core.php
More file actions
executable file
·218 lines (175 loc) · 6.17 KB
/
mp-core.php
File metadata and controls
executable file
·218 lines (175 loc) · 6.17 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
/*
Plugin Name: MP Core
Plugin URI: http://mintplugins.com
Description: A core group of classes and functions shared by all MintPlugins creating efficiency, robustness, and speed.
Version: 1.0.5.7
Author: Mint Plugins
Author URI: https://mintplugins.com
Text Domain: mp_core
Domain Path: languages
License: GPL2
*/
/* Copyright 2016 Phil Johnston (email : phil@mintplugins.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Mint Plugins Core.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Mint Plugins Core, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/*
|--------------------------------------------------------------------------
| CONSTANTS
|--------------------------------------------------------------------------
*/
// Plugin version
if( !defined( 'MP_CORE_VERSION' ) )
define( 'MP_CORE_VERSION', '1.0.5.7' );
// Plugin Folder URL
if( !defined( 'MP_CORE_PLUGIN_URL' ) )
define( 'MP_CORE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Plugin Folder Path
if( !defined( 'MP_CORE_PLUGIN_DIR' ) )
define( 'MP_CORE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
// Plugin Root File
if( !defined( 'MP_CORE_PLUGIN_FILE' ) )
define( 'MP_CORE_PLUGIN_FILE', __FILE__ );
// Javascripts URL - Used as a prefix to load javascript scripts (non core related) included with the core
if( !defined( 'MP_CORE_JS_SCRIPTS_URL' ) )
define( 'MP_CORE_JS_SCRIPTS_URL', plugin_dir_url( __FILE__ ) . 'includes/js/utility/' );
/*
|--------------------------------------------------------------------------
| GLOBALS
|--------------------------------------------------------------------------
*/
//None at the moment
/*
|--------------------------------------------------------------------------
| INTERNATIONALIZATION
|--------------------------------------------------------------------------
*/
function mp_core_textdomain() {
// Set filter for plugin's languages directory
$mp_core_lang_dir = dirname( plugin_basename( MP_CORE_PLUGIN_FILE ) ) . '/languages/';
$mp_core_lang_dir = apply_filters( 'mp_core_languages_directory', $mp_core_lang_dir );
// Traditional WordPress plugin locale filter
$locale = apply_filters( 'plugin_locale', get_locale(), 'mp-core' );
$mofile = sprintf( '%1$s-%2$s.mo', 'mp-core', $locale );
// Setup paths to current locale file
$mofile_local = $mp_core_lang_dir . $mofile;
$mofile_global = WP_LANG_DIR . '/mp-core/' . $mofile;
if ( file_exists( $mofile_global ) ) {
// Look in global /wp-content/languages/mp_core folder
load_textdomain( 'mp_core', $mofile_global );
} elseif ( file_exists( $mofile_local ) ) {
// Look in local /wp-content/plugins/message_bar/languages/ folder
load_textdomain( 'mp_core', $mofile_local );
} else {
// Load the default language files
load_plugin_textdomain( 'mp_core', false, $mp_core_lang_dir );
}
}
add_action( 'init', 'mp_core_textdomain', 1 );
/*
|--------------------------------------------------------------------------
| INCLUDES
|--------------------------------------------------------------------------
*/
/**
* Activation Hook Function
*/
require( MP_CORE_PLUGIN_DIR . 'includes/misc-functions/install.php' );
/**
* Include Plugin Installer Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/plugin-checker/class-plugin-installer.php' );
/**
* Include Plugin Checker Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/plugin-checker/class-plugin-checker.php' );
/**
* Include Plugin Directory Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/plugin-directory/class-plugin-directory.php' );
/**
* Include Mint Plugins Directory Page
*/
require( MP_CORE_PLUGIN_DIR . 'includes/plugin-directory/mp-core-plugin-directory.php' );
/**
* Include Theme Updater
*/
require( MP_CORE_PLUGIN_DIR . 'includes/updater/themes/class-theme-updater.php' );
/**
* Include Plugin Updater
*/
require( MP_CORE_PLUGIN_DIR . 'includes/updater/plugins/class-plugin-updater.php' );
/**
* Keep MP Core updated
*/
require( MP_CORE_PLUGIN_DIR . 'includes/updater/mp-core-update.php' );
/**
* Include Settings Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/settings/class-settings-php-5.2.php' );
/**
* Include Metabox Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/metaboxes/class-metabox.php' );
/**
* Include Widget Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/widgets/class-widget.php' );
/**
* Include Shortcode Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/shortcodes/class-shortcode-insert.php' );
/**
* Include Customizer Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/customizer/class-customizer.php' );
/**
* Include Font Class
*/
require( MP_CORE_PLUGIN_DIR . 'includes/fonts/class-font.php' );
/**
* Include AQ Resizer Function
*/
require( MP_CORE_PLUGIN_DIR . 'includes/aq-resizer/aq-resizer.php' );
require( MP_CORE_PLUGIN_DIR . 'includes/aq-resizer/aq-resizer-ratio-check.php' );
/**
* Template Tags
*/
require( MP_CORE_PLUGIN_DIR . 'includes/misc-functions/template-tags/template-tags.php' );
/**
* Get Data Functions
*/
require( MP_CORE_PLUGIN_DIR . 'includes/misc-functions/get-data.php' );
/**
* Misc Functions
*/
require( MP_CORE_PLUGIN_DIR . 'includes/misc-functions/misc-functions.php' );
/**
* Animation Functions
*/
require( MP_CORE_PLUGIN_DIR . 'includes/misc-functions/animation-functions.php' );
/**
* Include License Checking functions
*/
require( MP_CORE_PLUGIN_DIR . 'includes/licensing/licensing-functions.php' );
require( MP_CORE_PLUGIN_DIR . 'includes/licensing/class-show-license-form.php' );
/*
|--------------------------------------------------------------------------
| THEME SPECIFIC INCLUDES
|--------------------------------------------------------------------------
*/
/**
* Theme Specific scripts
*/
require( MP_CORE_PLUGIN_DIR . 'includes/theme-specific/theme-specific.php' );