get_template()
get_template() 检索当前主题的名称。Retrieve name of the current t…
get_template()
检索当前主题的名称。
Retrieve name of the current theme.
检索当前主题的名称。
Retrieve name of the current theme.
目录锚点:#返回#源码#笔记
返回(Return)
(string)模板名称。
源码(Source)
/**
* Retrieve name of the current theme.
*
* @since 1.5.0
*
* @return string Template name.
*/
function get_template() {
/**
* Filter the name of the current theme.
*
* @since 1.5.0
*
* @param string $template Current theme's directory name.
*/
return apply_filters( 'template', get_option( 'template' ) );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.5.0 | wp-includes/theme.php:304 | 5 | 3 |
笔记(Notes)
例子
请注意,如果当前激活了子主题,get_模板将返回父主题的名称,而不是子主题的名称。
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





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