函数原型
get_stylesheet_directory(): string
函数描述
Retrieves stylesheet directory path for the active theme.
是否弃用
未弃用
函数参数
无
函数返回值
string Path to active theme’s stylesheet directory.
函数位置
File: wp-includes/theme.php.
函数源码
function get_stylesheet_directory() {
$stylesheet = get_stylesheet();
$theme_root = get_theme_root( $stylesheet );
$stylesheet_dir = "$theme_root/$stylesheet";
/**
* Filters the stylesheet directory path for the active theme.
*
* @since 1.5.0
*
* @param string $stylesheet_dir Absolute path to the active theme.
* @param string $stylesheet Directory name of the active theme.
* @param string $theme_root Absolute path to themes directory.
*/
return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

