-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
121 lines (108 loc) · 3.43 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
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
<?php
/**
* Plugin Name: CMB2
* Plugin URI: https://github.com/WebDevStudios/CMB2
* Description: CMB2 will create metaboxes and forms with custom fields that will blow your mind.
* Author: WebDevStudios
* Author URI: http://webdevstudios.com
* Contributors: WebDevStudios (@webdevstudios / webdevstudios.com)
* Justin Sternberg (@jtsternberg / dsgnwrks.pro)
* Jared Atchison (@jaredatch / jaredatchison.com)
* Bill Erickson (@billerickson / billerickson.net)
* Andrew Norcross (@norcross / andrewnorcross.com)
*
* Version: 2.0.2
*
* Text Domain: cmb2
* Domain Path: languages
*
*
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*
* This is an add-on for WordPress
* http://wordpress.org/
*
* **********************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 not edit the code below
(or any code in the included files)
or things might explode!
*************************************************************************/
if ( ! class_exists( 'cmb2_bootstrap_202_trunk', false ) ) {
/**
* Check for newest version of CMB
*/
class cmb2_bootstrap_202_trunk {
/**
* Current version number
* @var string
* @since 1.0.0
*/
const VERSION = '2.0.2';
/**
* Current version hook priority
* Will decrement with each release
*
* @var int
* @since 2.0.0
*/
const PRIORITY = 9997;
public static $single = null;
public static function go() {
if ( null === self::$single ) {
self::$single = new self();
}
return self::$single;
}
private function __construct() {
/**
* A constant you can use to check if CMB2 is loaded
* for your plugins/themes with CMB2 dependency
*/
if ( ! defined( 'CMB2_LOADED' ) ) {
define( 'CMB2_LOADED', true );
}
add_action( 'init', array( $this, 'include_cmb' ), self::PRIORITY );
}
public function include_cmb() {
if ( ! class_exists( 'CMB2', false ) ) {
if ( ! defined( 'CMB2_VERSION' ) ) {
define( 'CMB2_VERSION', self::VERSION );
}
$this->l10ni18n();
require_once 'bootstrap.php';
}
}
/**
* Load CMB text domain
* @since 2.0.0
*/
public function l10ni18n() {
$loaded = load_plugin_textdomain( 'cmb2', false, '/languages/' );
if ( ! $loaded ) {
$loaded = load_muplugin_textdomain( 'cmb2', '/languages/' );
}
if ( ! $loaded ) {
$loaded = load_theme_textdomain( 'cmb2', '/languages/' );
}
if ( ! $loaded ) {
$locale = apply_filters( 'plugin_locale', get_locale(), 'cmb2' );
$mofile = dirname( __FILE__ ) . '/languages/cmb2-'. $locale .'.mo';
load_textdomain( 'cmb2', $mofile );
}
}
}
cmb2_bootstrap_202_trunk::go();
} // class exists check