Edit File by line
/home/zeestwma/ajeebong.../wp-conte.../plugins/cmb2
File: init.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* The initation loader for CMB2, and the main plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @category WordPress_Plugin
[4] Fix | Delete
* @package CMB2
[5] Fix | Delete
* @author CMB2 team
[6] Fix | Delete
* @license GPL-2.0+
[7] Fix | Delete
* @link https://cmb2.io
[8] Fix | Delete
*
[9] Fix | Delete
* Plugin Name: CMB2
[10] Fix | Delete
* Plugin URI: https://github.com/CMB2/CMB2
[11] Fix | Delete
* Description: CMB2 will create metaboxes and forms with custom fields that will blow your mind.
[12] Fix | Delete
* Author: CMB2 team
[13] Fix | Delete
* Author URI: https://cmb2.io
[14] Fix | Delete
* Contributors: Justin Sternberg (@jtsternberg / dsgnwrks.pro)
[15] Fix | Delete
* WebDevStudios (@webdevstudios / webdevstudios.com)
[16] Fix | Delete
* Human Made (@humanmadeltd / hmn.md)
[17] Fix | Delete
* Jared Atchison (@jaredatch / jaredatchison.com)
[18] Fix | Delete
* Bill Erickson (@billerickson / billerickson.net)
[19] Fix | Delete
* Andrew Norcross (@norcross / andrewnorcross.com)
[20] Fix | Delete
*
[21] Fix | Delete
* Version: 2.11.0
[22] Fix | Delete
*
[23] Fix | Delete
* Text Domain: cmb2
[24] Fix | Delete
* Domain Path: languages
[25] Fix | Delete
*
[26] Fix | Delete
*
[27] Fix | Delete
* Released under the GPL license
[28] Fix | Delete
* http://www.opensource.org/licenses/gpl-license.php
[29] Fix | Delete
*
[30] Fix | Delete
* This is an add-on for WordPress
[31] Fix | Delete
* https://wordpress.org/
[32] Fix | Delete
*
[33] Fix | Delete
* **********************************************************************
[34] Fix | Delete
* This program is free software; you can redistribute it and/or modify
[35] Fix | Delete
* it under the terms of the GNU General Public License as published by
[36] Fix | Delete
* the Free Software Foundation; either version 2 of the License, or
[37] Fix | Delete
* (at your option) any later version.
[38] Fix | Delete
*
[39] Fix | Delete
* This program is distributed in the hope that it will be useful,
[40] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[41] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[42] Fix | Delete
* GNU General Public License for more details.
[43] Fix | Delete
* **********************************************************************
[44] Fix | Delete
*/
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* *********************************************************************
[48] Fix | Delete
* You should not edit the code below
[49] Fix | Delete
* (or any code in the included files)
[50] Fix | Delete
* or things might explode!
[51] Fix | Delete
* ***********************************************************************
[52] Fix | Delete
*/
[53] Fix | Delete
[54] Fix | Delete
if ( ! class_exists( 'CMB2_Bootstrap_2110', false ) ) {
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Handles checking for and loading the newest version of CMB2
[58] Fix | Delete
*
[59] Fix | Delete
* @since 2.0.0
[60] Fix | Delete
*
[61] Fix | Delete
* @category WordPress_Plugin
[62] Fix | Delete
* @package CMB2
[63] Fix | Delete
* @author CMB2 team
[64] Fix | Delete
* @license GPL-2.0+
[65] Fix | Delete
* @link https://cmb2.io
[66] Fix | Delete
*/
[67] Fix | Delete
class CMB2_Bootstrap_2110 {
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* Current version number
[71] Fix | Delete
*
[72] Fix | Delete
* @var string
[73] Fix | Delete
* @since 1.0.0
[74] Fix | Delete
*/
[75] Fix | Delete
const VERSION = '2.11.0';
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Current version hook priority.
[79] Fix | Delete
* Will decrement with each release
[80] Fix | Delete
*
[81] Fix | Delete
* @var int
[82] Fix | Delete
* @since 2.0.0
[83] Fix | Delete
*/
[84] Fix | Delete
const PRIORITY = 9957;
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Single instance of the CMB2_Bootstrap_2110 object
[88] Fix | Delete
*
[89] Fix | Delete
* @var CMB2_Bootstrap_2110
[90] Fix | Delete
*/
[91] Fix | Delete
public static $single_instance = null;
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Creates/returns the single instance CMB2_Bootstrap_2110 object
[95] Fix | Delete
*
[96] Fix | Delete
* @since 2.0.0
[97] Fix | Delete
* @return CMB2_Bootstrap_2110 Single instance object
[98] Fix | Delete
*/
[99] Fix | Delete
public static function initiate() {
[100] Fix | Delete
if ( null === self::$single_instance ) {
[101] Fix | Delete
self::$single_instance = new self();
[102] Fix | Delete
}
[103] Fix | Delete
return self::$single_instance;
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Starts the version checking process.
[108] Fix | Delete
* Creates CMB2_LOADED definition for early detection by other scripts
[109] Fix | Delete
*
[110] Fix | Delete
* Hooks CMB2 inclusion to the init hook on a high priority which decrements
[111] Fix | Delete
* (increasing the priority) with each version release.
[112] Fix | Delete
*
[113] Fix | Delete
* @since 2.0.0
[114] Fix | Delete
*/
[115] Fix | Delete
private function __construct() {
[116] Fix | Delete
/**
[117] Fix | Delete
* A constant you can use to check if CMB2 is loaded
[118] Fix | Delete
* for your plugins/themes with CMB2 dependency
[119] Fix | Delete
*/
[120] Fix | Delete
if ( ! defined( 'CMB2_LOADED' ) ) {
[121] Fix | Delete
define( 'CMB2_LOADED', self::PRIORITY );
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
if ( ! function_exists( 'add_action' ) ) {
[125] Fix | Delete
// We are running outside of the context of WordPress.
[126] Fix | Delete
return;
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
add_action( 'init', array( $this, 'include_cmb' ), self::PRIORITY );
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
/**
[133] Fix | Delete
* A final check if CMB2 exists before kicking off our CMB2 loading.
[134] Fix | Delete
* CMB2_VERSION and CMB2_DIR constants are set at this point.
[135] Fix | Delete
*
[136] Fix | Delete
* @since 2.0.0
[137] Fix | Delete
*/
[138] Fix | Delete
public function include_cmb() {
[139] Fix | Delete
if ( class_exists( 'CMB2', false ) ) {
[140] Fix | Delete
return;
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
if ( ! defined( 'CMB2_VERSION' ) ) {
[144] Fix | Delete
define( 'CMB2_VERSION', self::VERSION );
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
if ( ! defined( 'CMB2_DIR' ) ) {
[148] Fix | Delete
define( 'CMB2_DIR', trailingslashit( dirname( __FILE__ ) ) );
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
$this->l10ni18n();
[152] Fix | Delete
[153] Fix | Delete
// Include helper functions.
[154] Fix | Delete
require_once CMB2_DIR . 'includes/CMB2_Base.php';
[155] Fix | Delete
require_once CMB2_DIR . 'includes/CMB2.php';
[156] Fix | Delete
require_once CMB2_DIR . 'includes/helper-functions.php';
[157] Fix | Delete
[158] Fix | Delete
// Now kick off the class autoloader.
[159] Fix | Delete
spl_autoload_register( 'cmb2_autoload_classes' );
[160] Fix | Delete
[161] Fix | Delete
// Kick the whole thing off.
[162] Fix | Delete
require_once( cmb2_dir( 'bootstrap.php' ) );
[163] Fix | Delete
cmb2_bootstrap();
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
/**
[167] Fix | Delete
* Registers CMB2 text domain path
[168] Fix | Delete
*
[169] Fix | Delete
* @since 2.0.0
[170] Fix | Delete
*/
[171] Fix | Delete
public function l10ni18n() {
[172] Fix | Delete
[173] Fix | Delete
$loaded = load_plugin_textdomain( 'cmb2', false, '/languages/' );
[174] Fix | Delete
[175] Fix | Delete
if ( ! $loaded ) {
[176] Fix | Delete
$loaded = load_muplugin_textdomain( 'cmb2', '/languages/' );
[177] Fix | Delete
}
[178] Fix | Delete
[179] Fix | Delete
if ( ! $loaded ) {
[180] Fix | Delete
$loaded = load_theme_textdomain( 'cmb2', get_stylesheet_directory() . '/languages/' );
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
if ( ! $loaded ) {
[184] Fix | Delete
$locale = apply_filters( 'plugin_locale', function_exists( 'determine_locale' ) ? determine_locale() : get_locale(), 'cmb2' );
[185] Fix | Delete
$mofile = dirname( __FILE__ ) . '/languages/cmb2-' . $locale . '.mo';
[186] Fix | Delete
load_textdomain( 'cmb2', $mofile );
[187] Fix | Delete
}
[188] Fix | Delete
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
// Make it so...
[194] Fix | Delete
CMB2_Bootstrap_2110::initiate();
[195] Fix | Delete
[196] Fix | Delete
}// End if().
[197] Fix | Delete
[198] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function