如何在订单后清除woocommerce结帐字段?
答
只需要在你的子主题的functions.php中添加这一条线上
add_filter('woocommerce_checkout_get_value','__return_empty_string',10);
答
您可以使用woocommerce_checkout_get_value过滤器清除字段,但每次页面加载时都会清除它们。
function clear_checkout_fields($input){
return '';
}
add_filter('woocommerce_checkout_get_value' , 'clear_checkout_fields');