函数原型
plugin_dir_url( string $file ): string
函数描述
Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in.
是否弃用
未弃用
函数参数
-
$file
string
Required - The filename of the plugin (__FILE__).
函数返回值
string the URL path of the directory that contains the plugin.
函数位置
File: wp-includes/plugin.php.
函数源码
function plugin_dir_url( $file ) {
return trailingslashit( plugins_url( '', $file ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |

