From 41c2549f2087032347beade453eb9b80951646ef Mon Sep 17 00:00:00 2001 From: Vedanshu Jain Date: Thu, 23 Mar 2023 16:06:16 +0530 Subject: [PATCH] Remove manual meta handling code since custom meta is synced now. --- .../DataStores/Orders/OrdersTableDataStore.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php index 410b6faa6cd..4050de796f1 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php @@ -1964,21 +1964,6 @@ FROM $order_meta_table $order->delete_meta_data( '_wp_trash_meta_comments_status' ); $order->save_meta_data(); - $data_synchronizer = wc_get_container()->get( DataSynchronizer::class ); - if ( $data_synchronizer->data_sync_is_enabled() ) { - // The previous $order->save() will have forced a sync to the posts table, - // this implies that the post status is not "trash" anymore, and thus - // wp_untrash_post would do nothing. - wp_update_post( - array( - 'ID' => $id, - 'post_status' => 'trash', - ) - ); - - wp_untrash_post( $id ); - } - return true; }