Include files for a plugin not including

In your main plugin file, use plugin_dir_path to define a constant that you can then use in all of your includes. see the example on the above codex page.

// define the constant in your main plugin file
define( 'MYPLUGINNAME_PATH', plugin_dir_path(__FILE__) );

then, to include your file:

include MYPLUGINNAME_PATH . 'includeme.php';

Leave a Comment