| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Kirki Customizer Framework |
| 4 |
* Plugin URI: https://www.themeum.com |
| 5 |
* Description: The Ultimate WordPress Customizer Framework |
| 6 |
* Author: Themeum |
| 7 |
* Author URI: https://www.themeum.com |
| 8 |
* Version: 5.2.1 |
| 9 |
* Text Domain: kirki |
| 10 |
* Requires at least: 5.3 |
| 11 |
* Requires PHP: 7.4 |
| 12 |
* |
| 13 |
* @package Kirki |
| 14 |
* @category Core |
| 15 |
* @author Themeum |
| 16 |
* @copyright Copyright (c) 2023, Themeum |
| 17 |
* @license https://opensource.org/licenses/MIT |
| 18 |
* @since 1.0 |
| 19 |
*/ |
| 20 |
|
| 21 |
use Kirki\L10n; |
| 22 |
use Kirki\Compatibility\Modules; |
| 23 |
use Kirki\Compatibility\Framework; |
| 24 |
use Kirki\Compatibility\Kirki; |
| 25 |
use Kirki\URL; |
| 26 |
|
| 27 |
// Exit if accessed directly. |
| 28 |
if ( ! defined( 'ABSPATH' ) ) { |
| 29 |
exit; |
| 30 |
} |
| 31 |
|
| 32 |
// No need to proceed if Kirki already exists. |
| 33 |
if ( class_exists( 'Kirki' ) ) { |
| 34 |
return; |
| 35 |
} |
| 36 |
|
| 37 |
if ( ! defined( 'KIRKI_PLUGIN_FILE' ) ) { |
| 38 |
define( 'KIRKI_PLUGIN_FILE', __FILE__ ); |
| 39 |
} |
| 40 |
|
| 41 |
require_once __DIR__ . '/customizer/lib/class-aricolor.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 42 |
require_once __DIR__ . '/customizer/lib/class-kirki-color.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 43 |
require_once __DIR__ . '/vendor/autoload.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 44 |
require_once __DIR__ . '/customizer/bootstrap.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 45 |
|
| 46 |
if ( ! defined( 'KIRKI_VERSION' ) ) { |
| 47 |
define( 'KIRKI_VERSION', '5.2.1' ); |
| 48 |
} |
| 49 |
|
| 50 |
if ( ! defined( 'KIRKI_PLUGIN_DIR' ) ) { |
| 51 |
define( 'KIRKI_PLUGIN_DIR', __DIR__ ); |
| 52 |
} |
| 53 |
|
| 54 |
if ( ! defined( 'KIRKI_PLUGIN_URL' ) ) { |
| 55 |
define( 'KIRKI_PLUGIN_URL', URL::get_from_path( __DIR__ ) ); |
| 56 |
} |
| 57 |
|
| 58 |
if ( ! function_exists( 'Kirki' ) ) { |
| 59 |
/** |
| 60 |
* Returns an instance of the Kirki object. |
| 61 |
*/ |
| 62 |
function kirki() { |
| 63 |
$kirki = Framework::get_instance(); |
| 64 |
return $kirki; |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
// Start Kirki. |
| 69 |
global $kirki; |
| 70 |
$kirki = kirki(); |
| 71 |
|
| 72 |
// Instantiate the modules. |
| 73 |
$kirki->modules = new Modules(); |
| 74 |
|
| 75 |
// Instantiate classes. |
| 76 |
new Kirki(); |
| 77 |
new L10n( 'kirki', __DIR__ . '/languages' ); |
| 78 |
new \Kirki\Settings\SetupSettings(); |
| 79 |
|
| 80 |
// Add an empty config for global fields. |
| 81 |
Kirki::add_config( '' ); // ? Bagus: what is this for? Adding empty config. |
| 82 |
|
| 83 |
// ? Bagus: Do we really need this line? custom-config.php here is supposed to inside this plugin. Or is this just in case we need it in the future? |
| 84 |
$custom_config_path = dirname( __FILE__ ) . '/custom-config.php'; |
| 85 |
$custom_config_path = wp_normalize_path( $custom_config_path ); |
| 86 |
if ( file_exists( $custom_config_path ) ) { |
| 87 |
require_once $custom_config_path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 88 |
} |
| 89 |
|
| 90 |
// Add upgrade notifications. |
| 91 |
require_once wp_normalize_path( dirname( __FILE__ ) . '/customizer/lib/upgrade-notifications.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 92 |
|
| 93 |
/** |
| 94 |
* To enable tests, add this line to your wp-config.php file (or anywhere else): |
| 95 |
* define( 'KIRKI_TEST', true ); |
| 96 |
* |
| 97 |
* Please note that the example.php file is not included in the wordpress.org distribution |
| 98 |
* and will only be included in dev versions of the plugin in the github repository. |
| 99 |
*/ |
| 100 |
if ( defined( 'KIRKI_TEST' ) && true === constant( 'KIRKI_TEST' ) && file_exists( dirname( __FILE__ ) . '/example.php' ) ) { |
| 101 |
include_once dirname( __FILE__ ) . '/example.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude |
| 102 |
} |
| 103 |
|
| 104 |
require_once __DIR__ . '/customizer/packages/index.php'; |