本文整理汇总了PHP中get_theme_roots函数的典型用法代码示例。如果您正苦于以下问题:PHP get_theme_roots函数的具体用法?PHP get_theme_roots怎么用?PHP get_theme_roots使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_theme_roots函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Paths_Init
private function Paths_Init()
{
$theme = realpath(get_template_directory());
$theme_dir_name = preg_split("/[\\/\\\\]/uis", $theme);
$theme_dir_name = (string) $theme_dir_name[count($theme_dir_name) - 1];
$this->paths = array('plugin_file_index' => __FILE__, 'themes' => WP_CONTENT_DIR . get_theme_roots(), 'theme' => $theme, 'theme_dir_name' => $theme_dir_name, 'theme_name' => wp_get_theme()->Name);
}
示例2: sniffing
/**
* スニッフィング
*
* @see wp-includes/template-loader.php
*/
function sniffing($template)
{
$ua =& wp_attache_mobile_controller::boot('ua');
if ($ua->_isMobile === true) {
$theme = get_template();
$themeRoots = get_theme_roots();
$uaTemplate = str_replace('.php', ".{$ua->_ua}.php", $template);
$mobileTemplate = str_replace('.php', ".{$ua->_agents['MOBILE']}.php", $template);
if (file_exists($uaTemplate)) {
$template = $uaTemplate;
} elseif (file_exists($mobileTemplate)) {
$template = $mobileTemplate;
}
}
return $template;
}
示例3: get_raw_theme_root
/**
* Get the raw theme root relative to the content directory with no filters applied.
*
* @since 3.1.0
*
* @param string $stylesheet_or_template The stylesheet or template name of the theme
* @param bool $skip_cache Optional. Whether to skip the cache. Defaults to false, meaning the cache is used.
* @return string Theme root
*/
function get_raw_theme_root($stylesheet_or_template, $skip_cache = false)
{
global $wp_theme_directories;
if (count($wp_theme_directories) <= 1) {
return '/themes';
}
$theme_root = false;
// If requesting the root for the current theme, consult options to avoid calling get_theme_roots()
if (!$skip_cache) {
if (get_option('stylesheet') == $stylesheet_or_template) {
$theme_root = get_option('stylesheet_root');
} elseif (get_option('template') == $stylesheet_or_template) {
$theme_root = get_option('template_root');
}
}
if (empty($theme_root)) {
$theme_roots = get_theme_roots();
if (!empty($theme_roots[$stylesheet_or_template])) {
$theme_root = $theme_roots[$stylesheet_or_template];
}
}
return $theme_root;
}
示例4: get_theme_root_uri
/**
* Retrieve URI for themes directory.
*
* Does not have trailing slash.
*
* @since 1.5.0
* @param $stylesheet_or_template The stylesheet or template name of the theme
*
* @return string Themes URI.
*/
function get_theme_root_uri($stylesheet_or_template = false)
{
$theme_roots = get_theme_roots();
if (isset($theme_roots[$stylesheet_or_template]) && $theme_roots[$stylesheet_or_template]) {
$theme_root_uri = content_url($theme_roots[$stylesheet_or_template]);
} else {
$theme_root_uri = content_url('themes');
}
return apply_filters('theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template);
}
示例5: getTmpl
/**
* @return string
*/
public function getTmpl()
{
return WP_CONTENT_DIR . '/' . get_theme_roots();
}
示例6: get_theme_roots
function get_theme_roots()
{
return get_theme_roots();
}