Code standards
This commit is contained in:
parent
1820c6a99d
commit
91f1f63100
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue