예제 #1
0
 /**
  * Returns the Kirki object
  */
 function Kirki()
 {
     // Make sure the class is instanciated
     $kirki = Kirki_Toolkit::get_instance();
     // The path of the current Kirki instance
     Kirki::$path = dirname(__FILE__);
     return $kirki;
 }
예제 #2
0
 /**
  * Returns the Kirki object
  */
 function Kirki()
 {
     // Make sure the class is instanciated
     $kirki = Kirki_Toolkit::get_instance();
     $kirki->font_registry = new Kirki_Google_Fonts_Registry();
     $kirki->api = new Kirki();
     $kirki->scripts = new Kirki_Scripts_Registry();
     $kirki->styles = array('back' => new Kirki_Styles_Customizer(), 'front' => new Kirki_Styles_Frontend());
     /**
      * The path of the current Kirki instance
      */
     Kirki::$path = dirname(__FILE__);
     return $kirki;
 }
예제 #3
0
 /**
  * Returns the Kirki object
  */
 function Kirki()
 {
     // Make sure the class is instanciated
     $kirki = Kirki_Toolkit::get_instance();
     $kirki->font_registry = new Kirki_Google_Fonts_Registry();
     $kirki->api = new Kirki();
     $kirki->scripts = new Kirki_Scripts_Registry();
     $kirki->styles = array('back' => new Kirki_Styles_Customizer(), 'front' => new Kirki_Styles_Frontend());
     /**
      * The path of the current Kirki instance
      */
     Kirki::$path = dirname(__FILE__);
     /**
      * Get the URL of the current Kirki instance.
      * In order to do that, first we'll have to determine if we're using Kirki
      * as a plugin, or if it's embedded in a theme.
      * We'll also have to do some ugly stuff below because Windows is messy
      * and we want to accomodate users using XAMPP for their development.
      * Seriously though guys, you should consider using Vagrant instead.
      */
     $dirname_no_slashes = str_replace(array('\\', '/'), '', dirname(__FILE__));
     $plugindir_no_slashes = str_replace(array('\\', '/'), '', WP_PLUGIN_DIR);
     $themedir_no_slashes = str_replace(array('\\', '/'), '', get_template_directory());
     if (false !== strpos($dirname_no_slashes, $plugindir_no_slashes)) {
         /**
          * Kirki is activated as a plugin.
          */
         Kirki::$url = plugin_dir_url(__FILE__);
     } else {
         if (false !== strpos($dirname_no_slashes, $themedir_no_slashes)) {
             /**
              * Kirki is embedded in a theme
              */
             Kirki::$url = get_template_directory_uri() . str_replace(get_template_directory(), '', dirname(__FILE__));
         }
     }
     return $kirki;
 }
예제 #4
0
파일: kirki.php 프로젝트: ZmagoD/kirki
 /**
  * Returns the Kirki object
  */
 function Kirki()
 {
     // Make sure the class is instanciated
     $kirki = Kirki_Toolkit::get_instance();
     $kirki->font_registry = new Kirki_Fonts_Font_Registry();
     $kirki->api = new Kirki();
     $kirki->scripts = new Kirki_Scripts_Registry();
     $kirki->styles = array('back' => new Kirki_Styles_Customizer(), 'front' => new Kirki_Styles_Frontend());
     /**
      * The path of the current Kirki instance
      */
     Kirki::$path = dirname(__FILE__);
     /**
      * The URL of the current Kirki instance
      */
     if (false !== strpos(dirname(__FILE__), WP_PLUGIN_DIR)) {
         /**
          * Kirki is activated as a plugin.
          */
         Kirki::$url = plugin_dir_url(__FILE__);
     } else {
         if (false !== strpos(dirname(__FILE__), get_template_directory())) {
             /**
              * Kirki is embedded in a theme
              */
             Kirki::$url = get_template_directory_uri() . str_replace(get_template_directory(), '', dirname(__FILE__));
         }
     }
     /**
      * Apply the filters to the Kirki::$url
      */
     $config = apply_filters('kirki/config', array());
     if (isset($config['url_path'])) {
         Kirki::$url = esc_url_raw($config['url_path']);
     }
     return $kirki;
 }
예제 #5
0
파일: kirki.php 프로젝트: pagelab/kirki
if (class_exists('Kirki')) {
    return;
}
// Include the autoloader.
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'autoloader.php';
// Gets an instance of the main Kirki object.
if (!function_exists('Kirki')) {
    function Kirki()
    {
        $kirki = Kirki_Toolkit::get_instance();
        return $kirki;
    }
}
// Start Kirki.
global $kirki;
$kirki = Kirki();
// Make sure the path is properly set.
Kirki::$path = wp_normalize_path(dirname(__FILE__));
// Instantiate 2ndary classes.
new Kirki_l10n();
new Kirki_Scripts_Registry();
new Kirki_Styles_Customizer();
new Kirki_Styles_Frontend();
new Kirki_Selective_Refresh();
new Kirki();
// Include deprecated functions & methods.
include_once wp_normalize_path(dirname(__FILE__) . '/includes/deprecated.php');
// Include the ariColor library.
include_once wp_normalize_path(dirname(__FILE__) . '/includes/lib/class-aricolor.php');
// Add an empty config for global fields.
Kirki::add_config('');