Refunds cannot be trashed
Avoid trashed status after deleting a refund. Fixes #13200
This commit is contained in:
parent
dda98da4ad
commit
f664fb955f
|
@ -33,6 +33,19 @@ class WC_Order_Refund_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT im
|
||||||
'_payment_tokens',
|
'_payment_tokens',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a refund - no trash is supported.
|
||||||
|
* @param WC_Order
|
||||||
|
* @param array $args Array of args to pass to the delete method.
|
||||||
|
*/
|
||||||
|
public function delete( &$order, $args = array() ) {
|
||||||
|
$id = $order->get_id();
|
||||||
|
|
||||||
|
wp_delete_post( $id );
|
||||||
|
$order->set_id( 0 );
|
||||||
|
do_action( 'woocommerce_delete_order', $id );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read refund data. Can be overridden by child classes to load other props.
|
* Read refund data. Can be overridden by child classes to load other props.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue