コード例 #1
0
 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
0
 /**
  * スニッフィング
  * 
  * @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
0
ファイル: theme.php プロジェクト: radman/noobyo-blog
/**
 * 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
0
ファイル: theme.php プロジェクト: smrpr/Fatlace
/**
 * 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
0
ファイル: Path.php プロジェクト: JBZoo/CrossCMS
 /**
  * @return string
  */
 public function getTmpl()
 {
     return WP_CONTENT_DIR . '/' . get_theme_roots();
 }
コード例 #6
0
 function get_theme_roots()
 {
     return get_theme_roots();
 }