我正在制作需要结帐表格的插件。当我包含form-checkout.php
致命错误:未捕获错误:在C:\ xampp7 \ htdocs \ woo \ wp-content \ plugins \ wooinstant \ inc \ templates \ checkout \ form-checkout.php:28中调用成员函数is_registration_enabled()上的null堆栈跟踪:#0 C:\ xampp7 \ htdocs \ woo \ wp-content \ plugins \ wooinstant \ inc \ wooinstant-layout.php(19):include()#1 C:\ xampp7 \ htdocs \ woo \ wp-includes \ class-wp-hook.php(286):wooinstant_layout('')#2 C:\ xampp7 \ htdocs \ woo \ wp-includes \ class-wp-hook.php(310):WP_Hook-> apply_filters(NULL,阵列)#3 C:\ xampp7 \ htdocs \ woo \ wp-includes \ plugin.php(453):WP_Hook-> do_action(Array)#4 C:\ xampp7 \ htdocs \ woo \ wp-includes \ general-template。 php(2630):do_action('wp_footer')#5 C:\ xampp7 \ htdocs \ woo \ wp-content \ themes \ twentyseventeen \ footer.php(44):wp_footer()#6 C:\ xampp7 \ htdocs \ woo \ wp-includes \ template.php(688):require_once('C:\ xampp7 \ htdoc ...')#7 C:\ xampp7 \ htdocs \ woo \ wp-includes \ template.php(647):load_template( 'C:\ xampp7 \ htdoc ...',true)#8 C:\ xampp7 \ htdocs \ woo \ wp-includes \ general-template.php(76):locate_template(Array, true)#28上的C:\ xampp7 \ htdocs \ woo \ wp-content \ plugins \ wooinstant \ inc \ templates \ checkout \ form-checkout.php中的#9 C:\ xampp7 \ htdocs \ woo \ wp-con >
我要包含这样的结帐表单文件
include plugin_dir_path( __FILE__ ) . '/templates/checkout/form-checkout.php';
我不想在那里使用[woocommerce_checkout]
。