plugins_url
云策文档标注
概述
plugins_url 是一个 WordPress 过滤器,用于修改插件目录的 URL。它允许开发者自定义插件相关资源的路径。
关键要点
- 过滤器名称:plugins_url
- 参数:$url(完整插件目录 URL)、$path(相对路径)、$plugin(插件文件路径)
- 返回:应用过滤器后的 URL
- 相关函数:plugins_url() 用于获取插件目录中的 URL
代码示例
return apply_filters( 'plugins_url', $url, $path, $plugin );注意事项
- 参数 $path 和 $plugin 可为空字符串
- 此过滤器自 WordPress 2.8.0 版本引入
原文内容
Filters the URL to the plugins directory.
Parameters
$urlstring-
The complete URL to the plugins directory including scheme and path.
$pathstring-
Path relative to the URL to the plugins directory. Blank string if no path is specified.
$pluginstring-
The plugin file path to be relative to. Blank string if no plugin is specified.
Source
return apply_filters( 'plugins_url', $url, $path, $plugin );
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |