diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index 83b5d31db94..9b1ca2f0b5b 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -448,6 +448,9 @@ function wc_create_refund( $args = array() ) { if ( ! $updating ) { update_post_meta( $refund_id, '_refund_amount', wc_format_decimal( $args['amount'] ) ); update_post_meta( $refund_id, '_refund_tax', wc_format_decimal( $args['tax'] ) ); + + // Set the order type. + wp_set_object_terms( $refund_id, 'refund', 'order_type' ); } return new WC_Order_Refund( $refund_id );