如何要求Wordpress插件文件夹中的文件?

如何要求Wordpress插件文件夹中的文件?,wordpress,include,themes,Wordpress,Include,Themes,我在wp content/plugins/Stripe/安装了Stripe插件。我在theme/fifthteen/Payment.php中有一个名为“Payment.php”的页面。现在我想在我的Payment.php中包含文件wp content/plugins/stripe/stripe.php。我该怎么做呢?使用 插件url($path,$plugin) $path将保存插件中文件的路径 $path = 'stripe.php'; $plugin='stripe' ; include

我在wp content/plugins/Stripe/安装了Stripe插件。我在theme/fifthteen/Payment.php中有一个名为“Payment.php”的页面。现在我想在我的Payment.php中包含文件wp content/plugins/stripe/stripe.php。我该怎么做呢?

使用 插件url($path,$plugin)

$path将保存插件中文件的路径

$path = 'stripe.php';
$plugin='stripe' ;

include plugins_url($path,$plugin) ;
$plugin保存插件的名称

$path = 'stripe.php';
$plugin='stripe' ;

include plugins_url($path,$plugin) ;

也就是说,它需要插件的url('lib/Stripe.php','wp-full-Stripe');其中:lib/Stripe.php是我插件中文件的路径,wp full Stripe是插件名称(wp content/plugins中的文件夹名称)?我在第259行的D:\xampp\htdocs\wordpress\wp content\themes\twentyeven\paytest.php中遇到了一个致命错误:致命错误:require():无法打开必需的“”(include_path=”;D:\xampp\php\PEAR')(->上面的require语句行)错误显示插件文件夹未包含在路径中。您的插件是否在管理面板中可见。是否已注册?要注册,您需要在插件主文件中添加所需的注释。我将“require”替换为“include”,并且它也起了作用。非常感谢:)