• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_theme_roots函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
 }
开发者ID:linniepinski,项目名称:perssistant,代码行数:7,代码来源:mw-polylang-theme-strings.php


示例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;
 }
开发者ID:ryo88c,项目名称:WordPress-attache-mobile,代码行数:21,代码来源:ua_sniffer.php


示例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;
}
开发者ID:radman,项目名称:noobyo-blog,代码行数:32,代码来源:theme.php


示例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);
}
开发者ID:smrpr,项目名称:Fatlace,代码行数:20,代码来源:theme.php


示例5: getTmpl

 /**
  * @return string
  */
 public function getTmpl()
 {
     return WP_CONTENT_DIR . '/' . get_theme_roots();
 }
开发者ID:JBZoo,项目名称:CrossCMS,代码行数:7,代码来源:Path.php


示例6: get_theme_roots

 function get_theme_roots()
 {
     return get_theme_roots();
 }
开发者ID:BarkerCA,项目名称:parallax,代码行数:4,代码来源:url-path-shortcodes.php



注:本文中的get_theme_roots函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_theme_support函数代码示例发布时间:2022-05-15
下一篇:
PHP get_theme_root_uri函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap