plugin_dir_path

The timeline below displays how wordpress function plugin_dir_path has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.0

/**
 * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in.
 *
 * @since 2.8.0
 *
 * @param string $file The filename of the plugin (__FILE__).
 * @return string the filesystem path of the directory that contains the plugin.
 */
function plugin_dir_path($file)
{
    return trailingslashit(dirname($file));
}

WordPress Version: 3.9

/**
 * Gets the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in
 *
 * @since 2.8.0
 *
 * @param string $file The filename of the plugin (__FILE__)
 * @return string the filesystem path of the directory that contains the plugin
 */
function plugin_dir_path($file)
{
    return trailingslashit(dirname($file));
}

WordPress Version: 3.7

/**
 * Gets the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in
 * @package WordPress
 * @subpackage Plugin
 * @since 2.8
 *
 * @param string $file The filename of the plugin (__FILE__)
 * @return string the filesystem path of the directory that contains the plugin
 */
function plugin_dir_path($file)
{
    return trailingslashit(dirname($file));
}