我不确定woocommerce_before_add_to_cart_button
操作在请求序列中激发,但值得向functions.php
要查看是否加载CF7 js脚本文件,
add_action(\'wp_enqueue_scripts\', \'pre_register_cf7_files\');
function pre_register_cf7_files(){
wp_register_style(\'contact-form-7\', wpcf7_plugin_url( \'includes/css/styles.css\' ), array(), WPCF7_VERSION, \'all\' );
wp_register_script( \'contact-form-7\', wpcf7_plugin_url( \'includes/js/scripts.js\' ), array( \'jquery\' ), WPCF7_VERSION, true);
}
如果这不起作用,您唯一的解决方案将是
custom_before_add_to_cart_btn
函数的前面部分
request sequence.