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
You can define a variable into your main Php file. It should be at the root of your plugin folder. The file should be here : .../wp-content/plugins/plugin-folder/my-plugin.php
You can add into the file this line.
define( 'MYPLUGIN__PLUGIN_DIR_PATH', plugins_url('', __FILE__ ) );
After you can use your new variable anywhere into your plugin.
public function Test()
{
$folder2 = MYPLUGIN__PLUGIN_DIR_PATH . '/folder1/folder2/';
// $folder2 = .../wp-content/plugins/plugin-folder/folder1/folder2/
}
I hope it will help someone.