plugin_dir_path( string $file )

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


Parameters

$file

(string) (Required) The filename of the plugin (__FILE__).


Return

(string) the filesystem path of the directory that contains the plugin.


Source

File: wp-includes/plugin.php

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


Changelog

Changelog
Version Description
WP-2.8.0 Introduced.