本文整理汇总了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']);
}
}
示例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']);
}
}
示例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');
}
}
示例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;
}