WordPress at Your Fingertips

plugin_dir_path() WP 1.0

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

1 time — 0.000024 sec (very fast) | 50000 times — 0.08 sec (speed of light)

No Hooks.


String. the filesystem path of the directory that contains the plugin.


plugin_dir_path( $file );
$file(string) (required)
The filename of the plugin (__FILE__).


Since 2.8.0 Introduced.

Code of plugin_dir_path() WP 5.8.1

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

path (directory folder)

Plugins, Hooks

No comments
    Log In