Refund deleted hook parameter fix

This hook parameter dose not trigger in action due to delete that post. This should set '$order_id' as parameter
This commit is contained in:
Mohaiminul Islam 2015-07-04 14:17:05 +06:00
parent 474a11f036
commit 64f2e2bed0
1 changed files with 3 additions and 2 deletions

View File

@ -2159,10 +2159,11 @@ class WC_AJAX {
$refund_id = absint( $_POST['refund_id'] );
if ( $refund_id && 'shop_order_refund' === get_post_type( $refund_id ) ) {
wc_delete_shop_order_transients( wp_get_post_parent_id( $refund_id ) );
$order_id = wp_get_post_parent_id( $refund_id );
wc_delete_shop_order_transients( $order_id );
wp_delete_post( $refund_id );
do_action( 'woocommerce_refund_deleted', $refund_id );
do_action( 'woocommerce_refund_deleted', $order_id );
}
die();