其工作方式是在所有订单状态下添加过滤器显示选项。
Wooocommerce默认情况下仅在完成的订单中显示该按钮
此功能将以所有顺序显示选项按钮:
add_filter( \'woocommerce_valid_order_statuses_for_order_again\', \'add_order_again_status\', 10, 1);
function add_order_again_status($array){
$array = array_merge($array, array(\'on-hold\', \'processing\', \'pending-payment\', \'cancelled\', \'refunded\', \'completed\'));
return $array;
}