plugin_dir_path

函数


plugin_dir_path ( $file )
参数
  • (string)
    $file
    The filename of the plugin (__FILE__).
    Required:
返回值
  • (string) the filesystem path of the directory that contains the plugin.
定义位置
  • wp-includes/plugin.php
    , line 834
引入
2.8.0
弃用

Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.

function plugin_dir_path( $file ) {
	return trailingslashit( dirname( $file ) );
}