get_template_directory()
get_template_directory() 检索当前主题目录。Retrieve current them…
get_template_directory()
检索当前主题目录。
Retrieve current theme directory.
检索当前主题目录。
Retrieve current theme directory.
目录锚点:#返回#源码#笔记
返回(Return)
(string)模板目录路径。
源码(Source)
/**
* Retrieve current theme directory.
*
* @since 1.5.0
*
* @return string Template directory path.
*/
function get_template_directory() {
$template = get_template();
$theme_root = get_theme_root( $template );
$template_dir = "$theme_root/$template";
/**
* Filter the current theme directory path.
*
* @since 1.5.0
*
* @param string $template_dir The URI of the current theme directory.
* @param string $template Directory name of the current theme.
* @param string $theme_root Absolute path to the themes directory.
*/
return apply_filters( 'template_directory', $template_dir, $template, $theme_root );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.5.0 | wp-includes/theme.php:322 | 9 | 4 |
笔记(Notes)
包含一个PHP文件
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!