WordPress at a glance

plugin_dir_path() WP 1.0

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


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

1 time = 0.000024s = very fast | 50000 times = 0.08s = speed of light

No Hooks.


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

Список изменений

С версии 2.8.0 Введена.

Code of plugin_dir_path() WP 5.5.1

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

Related Functions

From tag: path (directory folder)

More from category: Plugins, Hooks

No comments
    Log In . Register