theme_file_uri
云策文档标注
概述
theme_file_uri 是一个 WordPress 过滤器钩子,用于过滤主题中文件的 URL。它允许开发者修改或替换主题文件的 URL,常用于自定义主题文件路径或添加额外处理。
关键要点
- theme_file_uri 是一个过滤器钩子,用于修改主题文件的 URL。
- 参数包括 $url(文件 URL)和 $file(请求的文件名)。
- 通过 apply_filters 调用,返回过滤后的 URL。
- 与 get_theme_file_uri() 函数相关,用于检索主题文件 URL。
- 自 WordPress 4.7.0 版本引入。
原文内容
Filters the URL to a file in the theme.
Parameters
$urlstring-
The file URL.
$filestring-
The requested file to search for.
Source
return apply_filters( 'theme_file_uri', $url, $file );
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |