plugin path wp code example
Example 1: how to get plugin directory path in wordpress
define( 'MY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
include( MY_PLUGIN_PATH . 'includes/admin-page.php');
include( MY_PLUGIN_PATH . 'includes/classes.php');
// etc.
Example 2: how to get plugin directory path in wordpress
function plugin_dir_path( $file ) {
return trailingslashit( dirname( $file ) );
}