get_plugin_directory url code example
Example 1: how to get plugin directory path in wordpress
foreach ( glob( plugin_dir_path( __FILE__ ) . "subfolder/*.php" ) as $file ) {
include_once $file;
}
Example 2: how to get plugin directory path in wordpress
function plugin_dir_path( $file ) {
return trailingslashit( dirname( $file ) );
}