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 mentioned by @tsl143 the function plugins_url() is what you want, along with the __FILE__
magic constant. If you call it from a file inside your plugin folder it will refer to that folder.
Example:
echo plugins_url( '' , __FILE__ );
//outputs: http://www.example.com/wp-content/plugins/my-plugin
echo plugins_url( 'images/logo.png' , __FILE__ );
//outputs: http://www.example.com/wp-content/plugins/my-plugin/images/logo.png