Codex tools: Log in
Contents |
Gets the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in
<?php plugin_dir_path( $file ); ?>
Defining a constant to include files in a plugin, with the correct path
<?php define( 'MYPLUGINNAME_PATH', plugin_dir_path(__FILE__) ); require MYPLUGINNAME_PATH . 'includes/class-metabox.php'; require MYPLUGINNAME_PATH . 'includes/class-widget.php'; ?>
Since: 2.8
plugin_dir_path() is located in wp-includes/plugin.php
plugins_url(), plugin_dir_url(), plugin_dir_path()