parent_theme_file_uri
云策文档标注
概述
parent_theme_file_uri 是一个 WordPress 过滤器钩子,用于修改父主题中文件的 URL。它允许开发者在获取父主题文件 URL 时进行自定义处理。
关键要点
- 这是一个过滤器钩子,用于过滤父主题文件的 URL。
- 接受两个参数:$url(文件 URL)和 $file(请求的文件名)。
- 在 WordPress 4.7.0 版本中引入。
- 与 get_parent_theme_file_uri() 函数相关,用于检索父主题文件的 URL。
原文内容
Filters the URL to a file in the parent theme.
Parameters
$urlstring-
The file URL.
$filestring-
The requested file to search for.
Source
return apply_filters( 'parent_theme_file_uri', $url, $file );
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |