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

