Undo regression in previous commit.

This commit is contained in:
Vedanshu Jain 2023-02-22 19:13:06 +05:30
parent 0b689ed8bd
commit 6d162a9950
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller {
*/
protected function prepare_object_for_database( $request, $creating = false ) {
$id = isset( $request['id'] ) ? absint( $request['id'] ) : 0;
$order = wc_get_order( $id );
$order = new WC_Order( $id );
$schema = $this->get_item_schema();
$data_keys = array_keys( array_filter( $schema['properties'], array( $this, 'filter_writable_props' ) ) );