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
As noted on the section Common Usage
of Plugins Url function reference page, that's what worked for me:
If you are using the plugins_url() function in a file that is nested inside a subdirectory of your plugin directory, you should use PHP's dirname() function:
echo plugins_url('', dirname(__FILE__) );
The output for this was:
http://domain/app/wp-content/plugins/my-plugin
The file that called the function was my functions.php
inside includes
, so the complete path to my file was:
http://domain/app/wp-content/plugins/my-plugin/includes/functions.php