Refunds cannot be trashed

Avoid trashed status after deleting a refund.

Fixes #13200
This commit is contained in:
Mike Jolley 2017-02-15 17:02:01 +00:00
parent dda98da4ad
commit f664fb955f
1 changed files with 13 additions and 0 deletions

View File

@ -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.
* *