WordPress at a glance

plugin_dir_path() WP 1.0

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

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

No Hooks.

Return

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

Usage

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

Code of plugin_dir_path: wp-includes/plugin.php VER 4.9.8

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

Related Functions

From tag: path (directory folder)

More from category: Plugins, Hooks

No comments
    Hello, !     Log In . Register