stylesheet_directory_uri
云策文档标注
概述
stylesheet_directory_uri 是一个 WordPress 过滤器,用于修改活动主题的样式表目录 URI。它允许开发者在获取主题样式表目录 URI 时进行自定义处理。
关键要点
- 这是一个过滤器 Hook,名称为 'stylesheet_directory_uri'。
- 接受三个参数:$stylesheet_dir_uri(样式表目录 URI)、$stylesheet(活动主题目录名)和 $theme_root_uri(主题根目录 URI)。
- 常用于 get_stylesheet_directory_uri() 函数中,以动态调整主题资源路径。
- 自 WordPress 1.5.0 版本引入。
原文内容
Filters the stylesheet directory URI.
Parameters
$stylesheet_dir_uristring-
Stylesheet directory URI.
$stylesheetstring-
Name of the activated theme’s directory.
$theme_root_uristring-
Themes root URI.
Source
return apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri );
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |