Path from custom plugin in wordpress

Before diving into the methods, let’s briefly understand the structure of a typical plugin folder in WordPress. When you install a plugin, it is stored in the wp-content/plugins/ directory. Each plugin has its own folder, named after the plugin itself. Inside the plugin folder, you’ll find the plugin’s files, including the main PHP file and any additional assets or resources.

$plugin_folder_path = plugin_dir_path( __FILE__ );
echo plugin_dir_url( __FILE__ );
https://imageconverter.downloadvideo4free.com/wp-content/plugins/my-imageconverter/
echo WP_PLUGIN_DIR;
/home/u624263432/domains/downloadvideo4free.com/public_html/imageconverter/wp-content/plugins
echo __FILE__;
/home/u624263432/domains/downloadvideo4free.com/public_html/imageconverter/wp-content/plugins/my-imageconverter/my-imageconverter.php
define( 'TOOL__FILE__', __FILE__ );
define( 'TOOL_PLUGIN_BASE', plugin_basename( TOOL__FILE__ ) );
define( 'TOOL_PATH', plugin_dir_path( TOOL__FILE__ ) );

echo TOOL_PATH;
require TOOL_PATH.'pngtojpg.php';

 

 

 

Leave a Reply