我在处理 Woocommerce 订单后调用 js 函数时遇到问题。我的中有以下代码functions.php:
add_action( 'wp_enqueue_scripts', 'enqueue_so_18552010' );
add_action( 'woocommerce_order_status_processing', 'purchaseCompleted' );
function enqueue_so_18552010()
{
wp_enqueue_script(
'my-java', // Handle
get_stylesheet_directory_uri() . '/js/custom.js?V=2020.08.01v12', // URL for child or parent themes
array( 'jquery' ), // Dependencies
false, // Version
true // In footer
);
}
function purchaseCompleted()
{
//JS FUNCTION'S CALL GOES HERE
}
我想调用文件中的js函数custom.js,但到目前为止我还没有成功。我能够从不相关的页面模板调用该文件中的函数,但不使用该woocommerce_order_status_processing调用。这可能吗?
千万里不及你
当年话下
蝴蝶刀刀