From e6752932dd4cca2705cc2681c56b94dd199a3ae9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 10 Mar 2017 19:05:32 +0000 Subject: [PATCH] Sort --- includes/api/class-wc-rest-order-refunds-controller.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/api/class-wc-rest-order-refunds-controller.php b/includes/api/class-wc-rest-order-refunds-controller.php index 9119ea2d952..c6f6206788e 100644 --- a/includes/api/class-wc-rest-order-refunds-controller.php +++ b/includes/api/class-wc-rest-order-refunds-controller.php @@ -179,6 +179,9 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller { $data['fee_lines'], $data['coupon_lines'] ); + ksort( $data ); + + $data = array_merge( array( 'id' => $object->get_id() ), $data ); $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context );