Is there any function that would return the full path of my plugin in WordPress?
Example is
path/wp-contents/plugins/myplugin
I have tr
Kinda late to this party, but just in case some else stumbles upon this.
plugin_dir_path(__FILE__)
will always return the current path (where the file calling it is located).
If you want the root, use the code below:
plugin_dir_path( dirname( __FILE__ ) )
You can then define a constant:
define( 'YOUR_PLUGIN_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
require_once YOUR_PLUGIN_PATH . 'includes/admin-page.php'
require_once YOUR_PLUGIN_PATH . 'admin/classes.php'