我有以下代码正在尝试使用woocommerce_subscription_status_pending-cancel
挂钩在WooCommerce商店中实现
add_action('woocommerce_subscription_status_pending-cancel', 'set_gravform_cancel_cookie');
function set_gravform_cancel_cookie($subscription_id) {
setcookie("gravform4", "hello", time() + (86400 * 30), "/"); // 86400 = 1 day
}
我正在尝试设置一个在客户取消订阅之后的cookie。
但是无论出于何种原因,cookie都不会在此wc挂钩中设置。