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.000024 sec (very fast) | 50000 times — 0.08 sec (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__).

Changelog

Since 2.8.0 Introduced.

Code of plugin_dir_path() WP 5.7.2

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

From tag: path (directory folder)

More from category: Plugins, Hooks

No comments
    Log In