当前位置: 首页>>代码示例>>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;未经允许,请勿转载。