Code standards

This commit is contained in:
Mike Jolley 2017-09-01 11:02:11 +01:00
parent 1820c6a99d
commit 91f1f63100
1 changed files with 7 additions and 7 deletions

View File

@ -284,13 +284,6 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
'restock_items' => true,
) );
if(!empty( $request['meta_data'] ) && is_array( $request['meta_data'] )) {
foreach ( $request['meta_data'] as $meta ) {
$refund->update_meta_data( $meta['key'], $meta['value'], isset( $meta['id'] ) ? $meta['id'] : '' );
}
$refund->save_meta_data();
}
if ( is_wp_error( $refund ) ) {
return new WP_Error( 'woocommerce_rest_cannot_create_order_refund', $refund->get_error_message(), 500 );
}
@ -299,6 +292,13 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
return new WP_Error( 'woocommerce_rest_cannot_create_order_refund', __( 'Cannot create order refund, please try again.', 'woocommerce' ), 500 );
}
if ( ! empty( $request['meta_data'] ) && is_array( $request['meta_data'] ) ) {
foreach ( $request['meta_data'] as $meta ) {
$refund->update_meta_data( $meta['key'], $meta['value'], isset( $meta['id'] ) ? $meta['id'] : '' );
}
$refund->save_meta_data();
}
/**
* Filters an object before it is inserted via the REST API.
*