當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kirki::url方法代碼示例

本文整理匯總了PHP中Kirki::url方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kirki::url方法的具體用法?PHP Kirki::url怎麽用?PHP Kirki::url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kirki的用法示例。


在下文中一共展示了Kirki::url方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function kirki_filtered_url()
 {
     $config = apply_filters('kirki/config', array());
     if (isset($config['url_path'])) {
         Kirki::$url = esc_url_raw($config['url_path']);
     }
 }
開發者ID:TheSkin,項目名稱:skin-toolkit-plugin,代碼行數:7,代碼來源:kirki.php

示例2: set_url

 /**
  * Properly set the Kirki URL for assets.
  * Determines if Kirki is installed as a plugin, in a child theme, or a parent theme
  * and then does some calculations to get the proper URL for its CSS & JS assets.
  */
 public function set_url()
 {
     // The path of the Kirki's parent-folder.
     $path = wp_normalize_path(dirname(Kirki::$path));
     // Get parent-theme path.
     $parent_theme_path = get_template_directory();
     $parent_theme_path = wp_normalize_path($parent_theme_path);
     // Get child-theme path.
     $child_theme_path = get_stylesheet_directory_uri();
     $child_theme_path = wp_normalize_path($child_theme_path);
     Kirki::$url = plugin_dir_url(dirname(__FILE__) . 'kirki.php');
     // Is Kirki included in a parent theme?
     if (false !== strpos(Kirki::$path, $parent_theme_path)) {
         Kirki::$url = get_template_directory_uri() . str_replace($parent_theme_path, '', Kirki::$path);
     }
     // Is there a child-theme?
     if ($child_theme_path !== $parent_theme_path) {
         // Is Kirki included in a child theme?
         if (false !== strpos(Kirki::$path, $child_theme_path)) {
             Kirki::$url = get_template_directory_uri() . str_replace($child_theme_path, '', Kirki::$path);
         }
     }
     // Apply the kirki/config filter.
     $config = apply_filters('kirki/config', array());
     if (isset($config['url_path'])) {
         Kirki::$url = esc_url_raw($config['url_path']);
     }
 }
開發者ID:aristath,項目名稱:kirki,代碼行數:33,代碼來源:class-kirki-init.php

示例3: set_url

 /**
  * Properly set the Kirki URL for assets
  * Determines if Kirki is installed as a plugin, in a child theme, or a parent theme
  * and then does some calculations to get the proper URL for its CSS & JS assets
  *
  * @return string
  */
 public function set_url()
 {
     /**
      * Are we on a parent theme?
      */
     if (Kirki_Toolkit::is_parent_theme(__FILE__)) {
         $relative_url = str_replace(Kirki_Toolkit::clean_file_path(get_template_directory()), '', dirname(dirname(__FILE__)));
         Kirki::$url = trailingslashit(get_template_directory_uri() . $relative_url);
     } elseif (Kirki_Toolkit::is_child_theme(__FILE__)) {
         $relative_url = str_replace(Kirki_Toolkit::clean_file_path(get_stylesheet_directory()), '', dirname(dirname(__FILE__)));
         Kirki::$url = trailingslashit(get_stylesheet_directory_uri() . $relative_url);
     } else {
         Kirki::$url = plugin_dir_url(dirname(__FILE__) . 'kirki.php');
     }
 }
開發者ID:1bigidea,項目名稱:kirki,代碼行數:22,代碼來源:class-kirki-init.php

示例4: 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;
 }
開發者ID:ZmagoD,項目名稱:kirki,代碼行數:40,代碼來源:kirki.php


注:本文中的Kirki::url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。