^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数get_raw_theme_root()用法示例

get_raw_theme_root( string $stylesheet_or_template,  bool $skip_cache = false )

Get the raw theme root relative to the content directory with no filters applied.


描述


参数

$stylesheet_or_template

(string)
(Required)
The stylesheet or template name of the theme

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包

$skip_cache

(bool)
(Optional)
Whether to skip the cache. Defaults to false, meaning the cache is used.

Default value: false


返回值

(string) Theme root


源代码

File: wp-includes/theme.php

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;
}

更新日志

Version 描述
3.1.0 Introduced.

相关函数

Uses

  • wp-includes/theme.php:
    get_theme_roots()
  • wp-includes/option.php:
    get_option()

Used By

  • wp-includes/class-wp-customize-manager.php:
    WP_Customize_Manager::get_template_root()
  • wp-includes/class-wp-customize-manager.php:
    WP_Customize_Manager::get_stylesheet_root()
  • wp-includes/theme.php:
    get_theme_root()
  • wp-includes/theme.php:
    get_theme_root_uri()
  • wp-includes/theme.php:
    switch_theme()
  • wp-includes/theme.php:
    wp_get_themes()
  • wp-includes/theme.php:
    wp_get_theme()
  • Show 2 more used by
    Hide more used by


让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈