Delete function
-
Can somebody please explain me this code snipit? pretty please?
function delete_order( $id, $force = false ) { $id = $this->validate_request( $id, 'shop_order', 'delete' ); return $this->delete( $id, 'order', ( 'true' === $force ) ); }
I used it in my autocomplete order and delete order hook but it doesn’t do any change.
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); function custom_woocommerce_auto_complete_order( $order_id ) { global $woocommerce; if ( !$order_id ) return; $order = new WC_Order( $order_id ); $order->update_status( 'completed' ); function delete_order( $id, $force = false ) { $id = $this->validate_request( $id, 'shop_order', 'delete' ); return $this->delete( $id, 'order', ( 'true' === $force ) ); } }
- The topic ‘Delete function’ is closed to new replies.