curver/functions/kirki/kirki.php

108 lines
3.4 KiB
PHP
Raw Normal View History

2019-02-10 20:21:07 +01:00
<?php
/**
* Plugin Name: Kirki Toolkit
* Plugin URI: http://aristath.github.io/kirki
* Description: The ultimate WordPress Customizer Toolkit
2019-02-17 14:28:35 +01:00
* Author: Ari Stathopoulos (@aristath)
2019-02-10 20:21:07 +01:00
* Author URI: http://aristath.github.io
2019-03-11 16:19:14 +01:00
* Version: 3.0.38
2019-02-10 20:21:07 +01:00
* Text Domain: kirki
2019-02-17 14:28:35 +01:00
* Requires WP: 4.9
* Requires PHP: 5.3
2019-02-10 20:21:07 +01:00
* GitHub Plugin URI: aristath/kirki
* GitHub Plugin URI: https://github.com/aristath/kirki
*
* @package Kirki
* @category Core
2019-02-17 14:28:35 +01:00
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
2019-02-10 20:21:07 +01:00
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// No need to proceed if Kirki already exists.
if ( class_exists( 'Kirki' ) ) {
return;
}
// Include the autoloader.
2019-02-17 14:28:35 +01:00
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-kirki-autoload.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
new Kirki_Autoload();
if ( ! defined( 'KIRKI_PLUGIN_FILE' ) ) {
define( 'KIRKI_PLUGIN_FILE', __FILE__ );
}
// Define the KIRKI_VERSION constant.
if ( ! defined( 'KIRKI_VERSION' ) ) {
if ( ! function_exists( 'get_plugin_data' ) ) {
2019-02-17 14:28:35 +01:00
include_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
}
$data = get_plugin_data( KIRKI_PLUGIN_FILE );
$version = ( isset( $data['Version'] ) ) ? $data['Version'] : false;
define( 'KIRKI_VERSION', $version );
}
// Make sure the path is properly set.
2019-02-17 14:28:35 +01:00
Kirki::$path = wp_normalize_path( dirname( __FILE__ ) ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride
2019-02-10 20:21:07 +01:00
Kirki_Init::set_url();
new Kirki_Controls();
if ( ! function_exists( 'Kirki' ) ) {
/**
* Returns an instance of the Kirki object.
*/
function kirki() {
$kirki = Kirki_Toolkit::get_instance();
return $kirki;
}
}
// Start Kirki.
global $kirki;
$kirki = kirki();
// Instantiate the modules.
$kirki->modules = new Kirki_Modules();
Kirki::$url = plugins_url( '', __FILE__ );
// Instantiate classes.
new Kirki();
new Kirki_L10n();
// Include deprecated functions & methods.
2019-02-17 14:28:35 +01:00
require_once wp_normalize_path( dirname( __FILE__ ) . '/deprecated/deprecated.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
// Include the ariColor library.
2019-02-17 14:28:35 +01:00
require_once wp_normalize_path( dirname( __FILE__ ) . '/lib/class-aricolor.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
// Add an empty config for global fields.
Kirki::add_config( '' );
$custom_config_path = dirname( __FILE__ ) . '/custom-config.php';
$custom_config_path = wp_normalize_path( $custom_config_path );
if ( file_exists( $custom_config_path ) ) {
2019-02-17 14:28:35 +01:00
require_once $custom_config_path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
}
// Add upgrade notifications.
2019-02-17 14:28:35 +01:00
require_once wp_normalize_path( dirname( __FILE__ ) . '/upgrade-notifications.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
/**
* To enable tests, add this line to your wp-config.php file (or anywhere alse):
* define( 'KIRKI_TEST', true );
*
* Please note that the example.php file is not included in the wordpress.org distribution
* and will only be included in dev versions of the plugin in the github repository.
*/
if ( defined( 'KIRKI_TEST' ) && true === KIRKI_TEST && file_exists( dirname( __FILE__ ) . '/example.php' ) ) {
2019-02-17 14:28:35 +01:00
include_once dirname( __FILE__ ) . '/example.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
2019-02-10 20:21:07 +01:00
}